File tree 1 file changed +53
-1
lines changed
1 file changed +53
-1
lines changed Original file line number Diff line number Diff line change 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
+ ```
You can’t perform that action at this time.
0 commit comments