From 11cffe9de6d0bcb1468dbc4b1213ad1b61c25d5e Mon Sep 17 00:00:00 2001 From: Anton Khorev Date: Sun, 22 Jun 2025 19:48:52 +0300 Subject: [PATCH] Test redirects from relation history with show_redactions --- .../old_relations_controller_test.rb | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/test/controllers/old_relations_controller_test.rb b/test/controllers/old_relations_controller_test.rb index 0031519f7..850f69324 100644 --- a/test/controllers/old_relations_controller_test.rb +++ b/test/controllers/old_relations_controller_test.rb @@ -17,6 +17,23 @@ class OldRelationsControllerTest < ActionDispatch::IntegrationTest sidebar_browse_check :relation_history_path, relation.id, "old_elements/index" end + def test_index_show_redactions_to_unauthorized + relation = create(:relation, :with_history) + + get relation_history_path(:id => relation, :params => { :show_redactions => true }) + + assert_response :redirect + end + + def test_index_show_redactions_to_regular_user + relation = create(:relation, :with_history) + + session_for(create(:user)) + get relation_history_path(:id => relation, :params => { :show_redactions => true }) + + assert_response :redirect + end + def test_show relation = create(:relation, :with_history) -- 2.39.5