@@ -55,67 +55,44 @@ Feature: Generate HTML documentation from test examples
55
55
And the output should contain "1 example, 0 failures"
56
56
And the exit status should be 0
57
57
58
- Scenario : Create an index of all API examples, including all resources and examples
59
- Then the file "docs/index.html" should contain "<h2>Greetings</h2>"
60
- And the file "docs/index.html" should contain HTML:
61
- """
62
- <h2>Greetings</h2>
63
-
64
- <ul>
65
- <li>
66
- <a href="greetings/greeting_your_favorite_gem.html">Greeting your favorite gem</a>
67
- </li>
68
- </ul>
69
- """
58
+ Scenario : Create an index of all API examples, including all resources
59
+ When I open the index
60
+ Then I should see the following resources:
61
+ | Greetings |
70
62
71
63
Scenario : Example HTML documentation includes the parameters
72
- Then the file "docs/greetings/greeting_your_favorite_gem.html" should contain HTML:
73
- """
74
- <h3>Parameters</h3>
75
- <table>
76
- <thead>
77
- <tr>
78
- <th>Name</th>
79
- <th>Description</th>
80
- </tr>
81
- </thead>
82
- <tbody>
83
- <tr>
84
- <th>
85
- <span class="name">target</span>
86
- </th>
87
- <td>
88
- <span class="description">The thing you want to greet</span>
89
- </td>
90
- </tr>
91
- </tbody>
92
- </table>
93
- """
64
+ When I open the index
65
+ And I navigate to "Greeting your favorite gem"
66
+ Then I should see the following parameters:
67
+ | name | description |
68
+ | target | The thing you want to greet |
94
69
95
70
Scenario : Example HTML documentation includes the request information
96
- Then the file "docs/greetings/greeting_your_favorite_gem.html" should contain HTML:
71
+ When I open the index
72
+ And I navigate to "Greeting your favorite gem"
73
+ Then I should see the route is "GET /greetings?target=rspec_api_documentation"
74
+ And I should see the following request headers:
97
75
"""
98
- <h3>Request</h3>
99
- <h4>Headers</h4>
100
- <pre class="headers">Host: example.org
101
- Cookie: </pre>
102
- <h4>Route</h4>
103
- <pre class="request highlight">GET /greetings?target=rspec_api_documentation</pre>
104
- <h4>Query Parameters</h4>
105
- <pre class="request highlight">target: rspec_api_documentation</pre>
76
+ Host: example.org
77
+ Cookie:
78
+ """
79
+ And I should see the following query parameters:
80
+ """
81
+ target: rspec_api_documentation
106
82
"""
107
83
108
84
Scenario : Example HTML documentation includes the response information
109
- Then the file "docs/greetings/greeting_your_favorite_gem.html" should contain HTML:
85
+ When I open the index
86
+ And I navigate to "Greeting your favorite gem"
87
+ Then I should see the response status is "200 OK"
88
+ And I should see the following response headers:
89
+ """
90
+ Content-Type: application/json
91
+ Content-Length: 35
92
+ """
93
+ And I should see the following response_body:
110
94
"""
111
- <h3>Response</h3>
112
- <h4>Headers</h4>
113
- <pre class="headers">Content-Type: application/json
114
- Content-Length: 35</pre>
115
- <h4>Status</h4>
116
- <pre class="response_status">200 OK</pre>
117
- <h4>Body</h4>
118
- <pre class="response highlight">{
119
- "hello": "rspec_api_documentation"
120
- }</pre>
95
+ {
96
+ "hello" => "rspec_api_documentation"
97
+ }
121
98
"""
0 commit comments