Skip to content
This repository has been archived by the owner on Mar 1, 2023. It is now read-only.

Commit

Permalink
Added tests for $.ajax type and method settings
Browse files Browse the repository at this point in the history
  • Loading branch information
trabianmatt committed Jan 29, 2013
1 parent 3316286 commit 5b70ff5
Showing 1 changed file with 29 additions and 1 deletion.
30 changes: 29 additions & 1 deletion test/tb/lib/ti/ajax/settings_test.coffee
Expand Up @@ -571,6 +571,34 @@ describe '$.ajax settings', ->
$.ajax '/test', settings

describe 'timeout', ->
describe 'type', ->
describe 'type and method', ->

beforeEach ->

Ti.Network.HTTPClient.mocks.push
url: '/capture'
method: 'POST'
response: (data, xhr) ->
responseText: xhr?.headers['Content-Type']
contentType: 'text'

it 'should call the request using the specified type', (done) ->

settings =
type: 'POST'

$.ajax('/capture', settings).done -> done()

it 'should call the request using the specified method', (done) ->

settings =
method: 'POST'

$.ajax('/capture', settings).done -> done()

it 'should be "GET" by default', (done) ->

$.ajax('/test').done -> done()

describe 'url', ->
describe 'xhrFields', ->

0 comments on commit 5b70ff5

Please sign in to comment.