From 41e93bfb66f93fb6a2de42ee00e6b0f28f6b3e08 Mon Sep 17 00:00:00 2001 From: Anton Khorev Date: Tue, 11 Feb 2025 07:10:54 +0300 Subject: [PATCH] Make user creation code in unredact test similar to redact tests --- test/controllers/api/old_nodes_controller_test.rb | 6 ++---- test/controllers/api/old_ways_controller_test.rb | 3 +-- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/test/controllers/api/old_nodes_controller_test.rb b/test/controllers/api/old_nodes_controller_test.rb index 7bea5d9d3..0c5faa9f9 100644 --- a/test/controllers/api/old_nodes_controller_test.rb +++ b/test/controllers/api/old_nodes_controller_test.rb @@ -289,12 +289,11 @@ module Api # test the unredaction of an old version of a node, while being # authorised as a normal user. def test_unredact_node_normal_user - user = create(:user) node = create(:node, :with_history, :version => 2) old_node = node.old_nodes.find_by(:version => 1) redaction = create(:redaction) old_node.redact!(redaction) - auth_header = bearer_authorization_header user + auth_header = bearer_authorization_header post node_version_redact_path(*old_node.id), :headers => auth_header @@ -306,11 +305,10 @@ module Api # test the unredaction of an old version of a node, while being # authorised as a moderator. def test_unredact_node_moderator - moderator_user = create(:moderator_user) node = create(:node, :with_history, :version => 2) old_node = node.old_nodes.find_by(:version => 1) old_node.redact!(create(:redaction)) - auth_header = bearer_authorization_header moderator_user + auth_header = bearer_authorization_header create(:moderator_user) post node_version_redact_path(*old_node.id), :headers => auth_header diff --git a/test/controllers/api/old_ways_controller_test.rb b/test/controllers/api/old_ways_controller_test.rb index e879c42a9..6946d2ab1 100644 --- a/test/controllers/api/old_ways_controller_test.rb +++ b/test/controllers/api/old_ways_controller_test.rb @@ -307,11 +307,10 @@ module Api # test the unredaction of an old version of a way, while being # authorised as a moderator. def test_unredact_way_moderator - moderator_user = create(:moderator_user) way = create(:way, :with_history, :version => 2) old_way = way.old_ways.find_by(:version => 1) old_way.redact!(create(:redaction)) - auth_header = bearer_authorization_header moderator_user + auth_header = bearer_authorization_header create(:moderator_user) post way_version_redact_path(*old_way.id), :headers => auth_header -- 2.39.5