README.md in airborne-0.2.5 vs README.md in airborne-0.2.6
- old
+ new
@@ -139,11 +139,11 @@
```
For requests that require Query params you can pass a params hash into headers.
```ruby
-post 'http://example.com/api/v1/my_api', { }, { 'params' => {'param_key' => 'param_value' }
+post 'http://example.com/api/v1/my_api', { }, { 'params' => {'param_key' => 'param_value' } }
```
##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:
@@ -363,9 +363,20 @@
Airborne.configure do |config|
config.match_expected_default = true
config.match_actual_default = false
end
```
+
+`match_expected_default` requires all the keys in the expected JSON are present in the response.
+`match_actual_default` requires that the keys in the response are tested in the expected Hash.
+
+So you can do the following combinations:
+
+`match_expected_default=false`, `match_actual_default=false` - check only intersection
+`match_expected_default=false`, `match_actual_default=true` - raise on extra key in response
+`match_expected_default=true`, `match_actual_default=false` - raise on missing key in response
+`match_expected_default=true`, `match_actual_default=true` - expect exact match
+
Airborne sets `match_expected_default` to `true` and `match_actual_default` to `false` by default.
You can use the `match_expected` and `match_actual` settings to override your global defaults in test blocks like this.