README.md in airborne-0.2.9 vs README.md in airborne-0.2.10
- old
+ new
@@ -17,11 +17,11 @@
```
Or add it to your Gemfile:
```ruby
gem 'airborne'
```
-##Creating Tests
+## Creating Tests
```ruby
require 'airborne'
describe 'sample spec' do
@@ -105,11 +105,11 @@
expect_json_sizes(ids: 4)
end
end
```
-##Making requests
+## Making requests
Airborne uses `rest_client` to make the HTTP request, and supports all HTTP verbs. When creating a test, you can call any of the following methods: `get`, `post`, `put`, `patch`, `delete`, `head`, `options`. This will then give you access the following properties:
* `response` - The HTTP response returned from the request
* `headers` - A symbolized hash of the response headers returned by the request
@@ -142,11 +142,11 @@
```ruby
post 'http://example.com/api/v1/my_api', { }, { 'params' => {'param_key' => 'param_value' } }
```
-##Testing Rack Applications
+## Testing Rack Applications
If you have an existing Rack application like `sinatra` or `grape` you can run Airborne against your application and test without actually having a server running. To do that, just specify your rack application in your Airborne configuration:
```ruby
Airborne.configure do |config|
@@ -154,11 +154,11 @@
end
```
Under the covers, Airborne uses [rack-test](https://github.com/brynary/rack-test) to make the requests.
-##Rails Applications
+## Rails Applications
If you're testing an API you've written in Rails, Airborne plays along with `rspec-rails`:
```ruby
@@ -172,21 +172,21 @@
end
end
end
```
-##API
+## API
* `expect_json_types` - Tests the types of the JSON property values returned
* `expect_json` - Tests the values of the JSON property values returned
* `expect_json_keys` - Tests the existence of the specified keys in the JSON object
* `expect_json_sizes` - Tests the sizes of the JSON property values returned, also test if the values are arrays
* `expect_status` - Tests the HTTP status code returned
* `expect_header` - Tests for a specified header in the response
* `expect_header_contains` - Partial match test on a specified header
-##Path Matching
+## Path Matching
When calling `expect_json_types`, `expect_json`, `expect_json_keys` or `expect_json_sizes` you can optionally specify a path as a first parameter.
For example, if our API returns the following JSON:
@@ -307,11 +307,12 @@
get 'http://example.com/api/v1/array_with_nested'
expect_json_types('cars.*.owners.*', name: :string)
end
```
-##Dates
+## Dates
+
JSON has no support for dates, however airborne gives you the ability to check for dates using the following. For `expect_json_types` you would use it as you would for any of the other types:
```ruby
it 'should verify date type' do
get '/get_date' #api that returns {createdAt: "Mon Oct 20 2014 16:10:42 GMT-0400 (EDT)"}
@@ -328,10 +329,10 @@
#within the date callback, you can use regular RSpec expectations that work with dates
expect_json(createdAt: date { |value| expect(value).to be_between(prev_day, next_day) })
end
```
-##Configuration
+## Configuration
When setting up Airborne, you can call `configure` just like you would with `rspec`:
```ruby
#config is the RSpec configuration and can be used just like it