From d0c68c404147f36e92fdfe0d219c7e2bd6dfa6bb Mon Sep 17 00:00:00 2001 From: Anton Khorev Date: Sun, 9 Feb 2025 18:18:25 +0300 Subject: [PATCH] Test redacted element state after redaction action --- test/controllers/api/old_nodes_controller_test.rb | 2 ++ test/controllers/api/old_relations_controller_test.rb | 2 ++ test/controllers/api/old_ways_controller_test.rb | 2 ++ 3 files changed, 6 insertions(+) diff --git a/test/controllers/api/old_nodes_controller_test.rb b/test/controllers/api/old_nodes_controller_test.rb index 6ffb8c7ca..2dea49d4c 100644 --- a/test/controllers/api/old_nodes_controller_test.rb +++ b/test/controllers/api/old_nodes_controller_test.rb @@ -228,7 +228,9 @@ module Api auth_header = bearer_authorization_header create(:moderator_user) do_redact_node(node_v3, create(:redaction), auth_header) + assert_response :success, "should be OK to redact old version as moderator." + assert_predicate node_v3.reload, :redacted? # check moderator can still see the redacted data, when passing # the appropriate flag diff --git a/test/controllers/api/old_relations_controller_test.rb b/test/controllers/api/old_relations_controller_test.rb index 1e3953590..75fa5c77a 100644 --- a/test/controllers/api/old_relations_controller_test.rb +++ b/test/controllers/api/old_relations_controller_test.rb @@ -215,7 +215,9 @@ module Api auth_header = bearer_authorization_header create(:moderator_user) do_redact_relation(relation_v3, create(:redaction), auth_header) + assert_response :success, "should be OK to redact old version as moderator." + assert_predicate relation_v3.reload, :redacted? # check moderator can still see the redacted data, when passing # the appropriate flag diff --git a/test/controllers/api/old_ways_controller_test.rb b/test/controllers/api/old_ways_controller_test.rb index 84c2cef3f..9464b6232 100644 --- a/test/controllers/api/old_ways_controller_test.rb +++ b/test/controllers/api/old_ways_controller_test.rb @@ -223,7 +223,9 @@ module Api auth_header = bearer_authorization_header create(:moderator_user) do_redact_way(way_v3, create(:redaction), auth_header) + assert_response :success, "should be OK to redact old version as moderator." + assert_predicate way_v3.reload, :redacted? # check moderator can still see the redacted data, when passing # the appropriate flag -- 2.39.5