 
 
     it "should make a get xhr and call back with parsed json", ( done ) ->
-      vk.request "GET", fakeUrl, fakeParams, ( data ) ->
-        data.should.deep.equal fakeData
-
-        done()
+      vk.request
+        method: "GET"
+        url: fakeUrl
+        params: fakeParams
+        callback: ( data ) ->
+          data.should.deep.equal fakeData
+
+          done()
+
+      fakeXhr.requests.length.should.equal 1
+      expect( fakeXhr.requests[ 0 ].method ).to.equal "GET"
+      expect( fakeXhr.requests[ 0 ].withCredentials ).to.equal false
+      expect( fakeXhr.requests[ 0 ].url ).to.equal fakeUrl + "?foo=foo%202&bar=bar%2F2"
+
+      fakeXhr.requests[ 0 ].respond 200, {}, JSON.stringify fakeData
+
+
+    it "should make a post xhr and call back with parsed json", ( done ) ->
+      vk.request
+        method: "POST"
+        url: fakeUrl
+        params: fakeParams
+        callback: ( data ) ->
+          data.should.deep.equal fakeData
+
+          done()
+
+      fakeXhr.requests.length.should.equal 1
+      expect( fakeXhr.requests[ 0 ].method ).to.equal "POST"
+      expect( fakeXhr.requests[ 0 ].withCredentials ).to.equal false
+      expect( fakeXhr.requests[ 0 ].url ).to.equal fakeUrl
+      expect( fakeXhr.requests[ 0 ].requestHeaders ).to.have.property "Content-Type"
+      expect( fakeXhr.requests[ 0 ].requestHeaders[ "Content-Type"] ).to.contain "application/x-www-form-urlencoded"
+      expect( fakeXhr.requests[ 0 ].requestBody ).to.equal "foo=foo%202&bar=bar%2F2"
+
+      fakeXhr.requests[ 0 ].respond 200, {}, JSON.stringify fakeData
+
+
+    it "should use credentials when specified", ( done ) ->
+      vk.request
+        method: "GET"
+        url: fakeUrl
+        withCredentials: true
+        params: fakeParams
+        callback: ( data ) ->
+          data.should.deep.equal fakeData
+
+          done()
 
       fakeXhr.requests.length.should.equal 1
       expect( fakeXhr.requests[ 0 ].method ).to.equal "GET"



    it "should get the access token from login.vk.com", ( done ) ->
      vk.request = ( method, url, params, callback ) ->
        method.should.equal "GET"
        url.should.equal "https://login.vk.com/"
        params.should.deep.equal

        response:
          foo: "bar"

      vk.request = ({ method, url, params, callback }) ->
        params.should.deep.equal
          access_token: "fake-token"
          v: "fake-version"
