Add show_redactions checks to api old element show tests

This commit is contained in:
Anton Khorev 2025-02-09 18:38:22 +03:00
parent 46113c9cba
commit 1b977454f7
3 changed files with 24 additions and 0 deletions

View file

@ -151,6 +151,10 @@ module Api
get api_node_version_path(node, 1)
assert_response :forbidden, "Redacted node shouldn't be visible via the version API."
get api_node_version_path(node, 1, :show_redactions => "true")
assert_response :forbidden, "Redacted node shouldn't be visible via the version API when passing flag."
end
def test_show_redacted_normal_user
@ -160,6 +164,10 @@ module Api
get api_node_version_path(node, 1), :headers => bearer_authorization_header
assert_response :forbidden, "Redacted node shouldn't be visible via the version API, even when logged in."
get api_node_version_path(node, 1, :show_redactions => "true"), :headers => bearer_authorization_header
assert_response :forbidden, "Redacted node shouldn't be visible via the version API, even when logged in and passing flag."
end
# Ensure the lat/lon is formatted as a decimal e.g. not 4.0e-05

View file

@ -151,6 +151,10 @@ module Api
get api_relation_version_path(relation, 1)
assert_response :forbidden, "Redacted relation shouldn't be visible via the version API."
get api_relation_version_path(relation, 1, :show_redactions => "true")
assert_response :forbidden, "Redacted relation shouldn't be visible via the version API when passing flag."
end
def test_show_redacted_normal_user
@ -160,6 +164,10 @@ module Api
get api_relation_version_path(relation, 1), :headers => bearer_authorization_header
assert_response :forbidden, "Redacted relation shouldn't be visible via the version API, even when logged in."
get api_relation_version_path(relation, 1, :show_redactions => "true"), :headers => bearer_authorization_header
assert_response :forbidden, "Redacted relation shouldn't be visible via the version API, even when logged in and passing flag."
end
##

View file

@ -148,6 +148,10 @@ module Api
get api_way_version_path(way, 1)
assert_response :forbidden, "Redacted way shouldn't be visible via the version API."
get api_way_version_path(way, 1, :show_redactions => "true")
assert_response :forbidden, "Redacted way shouldn't be visible via the version API when passing flag."
end
def test_show_redacted_normal_user
@ -157,6 +161,10 @@ module Api
get api_way_version_path(way, 1), :headers => bearer_authorization_header
assert_response :forbidden, "Redacted way shouldn't be visible via the version API, even when logged in."
get api_way_version_path(way, 1, :show_redactions => "true"), :headers => bearer_authorization_header
assert_response :forbidden, "Redacted way shouldn't be visible via the version API, even when logged in and passing flag."
end
##