Skip to content

Commit

Permalink
add a test for keys ending in .json and .xml (#3768)
Browse files Browse the repository at this point in the history
* add a test for keys ending in .json and .xml

* update wording
  • Loading branch information
akostadinov committed May 30, 2024
1 parent 42c6152 commit 01140de
Showing 1 changed file with 19 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,25 @@ def setup
method: '_destroy',
format: :xml })

assert_response :success
assert_response :success, "response #{@response.response_code} for key #{rm_key}"
end
end

# to delete keys ending in .xml or .json via API, format has to be added to the url path
test 'destroy key with appended format to the path' do
%w[foo-key foo.key foo.key.xml foo.key.json].each do |rm_key|

application = @buyer.bought_cinstances.last
expect_backend_create_key(application, rm_key)
expect_backend_delete_key(application, rm_key)

application.application_keys.add(rm_key)

delete(admin_api_account_application_key_path(@buyer.id, application.id, rm_key + ".json"),
params: { provider_key: @provider.api_key,
method: '_destroy' })

assert_response :success, "response #{@response.response_code} for key #{rm_key}"
end
end

Expand Down

0 comments on commit 01140de

Please sign in to comment.