-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Request options in test cases
Prakhar Srivastav edited this page May 9, 2014
·
5 revisions
The request
object available is now available in tests. The following properties are available on that object -
- url:
string
- the final URL that the request is sent for - headers:
object
- Javascript object as a key-value pair - dataMode:
string
- One ofraw
,params
andurlencoded
- data:
object
- Javascript object as a key-value pair
All values in request.data
are strings. For example, form data of name = 'foo' and age = 10 will give you a json object like so { name: 'foo', age: '10' }
. Do remember to use a double equality when testing integers or type cast them explicitly before using strong equality.