Skip to content

Commit eb9079c

Browse files
author
Chris Drane
committed
Alter example spec section
This has been altered to take out any open_api code. Given there is only one example spec in the README document, my view is that it should not be specifically open_api, but just use the most general options. I have bumped the level of this section up by two levels, as it no longer fits under the open_api section of the format section. I have also taken out or re-factored instances of <response>, given I could not understand what the code did in this instance. I note that the example code in the repository is open_api, so there is already an example of open_api code.
1 parent 7742d4a commit eb9079c

File tree

1 file changed

+3
-10
lines changed

1 file changed

+3
-10
lines changed

README.md

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -320,21 +320,16 @@ paths:
320320
hide: true
321321
```
322322

323-
#### Example of spec file
323+
## Example of acceptance spec file
324324

325325
```ruby
326+
# spec/acceptance/orders_spec.rb
326327
resource 'Orders' do
327328
explanation "Orders resource"
328329

329-
authentication :apiKey, :api_key, description: 'Private key for API access', name: 'HEADER_KEY'
330330
header "Content-Type", "application/json"
331-
332-
let(:api_key) { generate_api_key }
333331

334332
get '/orders' do
335-
route_summary "This URL allows users to interact with all orders."
336-
route_description "Long description."
337-
338333
# This is manual way to describe complex parameters
339334
parameter :one_level_array, type: :array, items: {type: :string, enum: ['string1', 'string2']}, default: ['string1']
340335
parameter :two_level_array, type: :array, items: {type: :array, items: {type: :string}}
@@ -353,13 +348,11 @@ paths:
353348
context '200' do
354349
example_request 'Getting a list of orders' do
355350
expect(status).to eq(200)
356-
expect(response_body).to eq(<response>)
357351
end
358352
end
359353
end
360354

361355
put '/orders/:id' do
362-
route_summary "This is used to update orders."
363356

364357
with_options scope: :data, with_example: true do
365358
parameter :name, 'The order name', required: true
@@ -390,7 +383,7 @@ paths:
390383
}
391384
}
392385
expect(status).to eq(200)
393-
expect(response_body).to eq(<response>)
386+
expect(response_body).to eq(expected_response)
394387
end
395388
end
396389

0 commit comments

Comments
 (0)