Skip to content

Commit 4a1b06b

Browse files
committed
Merge branch 'master' of github.com:defrag/JsonMatcher
* 'master' of github.com:defrag/JsonMatcher: Update README.md Update README.md
2 parents 3d19b39 + 76323a6 commit 4a1b06b

File tree

1 file changed

+53
-1
lines changed

1 file changed

+53
-1
lines changed

README.md

+53-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,53 @@
1-
[![Build Status](https://travis-ci.org/defrag/JsonMatcher.svg)](https://travis-ci.org/defrag/JsonMatcher)
1+
JsonMatcher
2+
========
3+
***JsonMatcher*** lets You assert Your json like a gangster in Your test cases.
4+
5+
[![Build Status](https://travis-ci.org/defrag/JsonMatcher.svg)](https://travis-ci.org/defrag/JsonMatcher)
6+
7+
Example scenario for api in behat using mongo.
8+
---
9+
``` cucumber
10+
@profile, @user
11+
Feature: Listing user toys
12+
13+
As a user
14+
I want to list my toys
15+
16+
Background:
17+
Given I send and accept JSON
18+
19+
Scenario: Listing timesheets
20+
Given the following users exist:
21+
| firstName | lastName |
22+
| Chuck | Norris |
23+
24+
And the following toys user "Chuck Norris" exist:
25+
| name |
26+
| Barbie |
27+
| GI Joe |
28+
| Optimus Prime |
29+
30+
When I set valid authorization code oauth header for user "Chuck Norris"
31+
And I send a GET request on "/api/toys"
32+
Then the response status code should be 200
33+
And the JSON response should match:
34+
"""
35+
[
36+
{
37+
"id": "@string@",
38+
"name": "Barbie",
39+
"_links: "*"
40+
},
41+
{
42+
"id": "@string@",
43+
"name": "GI Joe",
44+
"_links": "*"
45+
},
46+
{
47+
"id": "@string@",
48+
"name": "Optimus Prime",
49+
"_links": "*"
50+
}
51+
]
52+
"""
53+
```

0 commit comments

Comments
 (0)