Commit c11c1d5
committed
Add test helper that returns content item
stub_conditional_loader_returns_content_item helper corresponds to GdsApi
adapters helpers stubs:
- https://github.com/alphagov/gds-api-adapters/blob/4d4b2ab6969f333eb1cab94ff8e93d7ff8aeebf1/lib/gds_api/test_helpers/content_store.rb#L21
- https://github.com/alphagov/gds-api-adapters/blob/4d4b2ab6969f333eb1cab94ff8e93d7ff8aeebf1/lib/gds_api/test_helpers/publishing_api.rb#L210
The Struct mimics WebMock response returned by the stubs. The `to_h` method
parses JSON, like WebMock middleware would.
I considered returning a RestClient::Response but has a lot of unnecessary
complexity (e.g. redirect history). A lightweight Response struct seems
sufficient.1 parent f595f91 commit c11c1d5
File tree
2 files changed
+35
-0
lines changed- lib
- govuk_content_item_loader
2 files changed
+35
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
0 commit comments