Skip to content

Commit

Permalink
Merge pull request #862 from alphagov/make-patch-conflict-key-agnostic
Browse files Browse the repository at this point in the history
Make the new patch_conflict stub agnostic to keys
  • Loading branch information
benthorner committed Nov 5, 2018
2 parents 9c0d07d + ff1ff1c commit 7f4708f
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lib/gds_api/test_helpers/publishing_api_v2.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def stub_publishing_api_put_content(content_id, body, response_hash = {})
# "links" => {
# "taxons" => %w(level_one_topic level_two_topic),
# },
# "previous_version" => "3",
# "previous_version" => 3,
# )
#
# @param content_id [UUID]
Expand All @@ -57,13 +57,14 @@ def stub_publishing_api_patch_links(content_id, body)
# "links" => {
# "taxons" => %w(level_one_topic level_two_topic),
# },
# "previous_version" => "3",
# "previous_version" => 3,
# )
#
# @param content_id [UUID]
# @param body [String]
def stub_publishing_api_patch_links_conflict(content_id, body)
override_response_hash = { status: 409, body: version_conflict(body[:previous_version]) }
previous_version = JSON.parse(body.to_json)["previous_version"]
override_response_hash = { status: 409, body: version_conflict(previous_version) }
stub_publishing_api_patch(content_id, body, '/links', override_response_hash)
end

Expand Down

0 comments on commit 7f4708f

Please sign in to comment.