From 01994def7b68293bde92e6c11ed5bc2eacf5057d Mon Sep 17 00:00:00 2001 From: Anton Khorev Date: Sun, 22 Jun 2025 19:42:09 +0300 Subject: [PATCH] Test redirects from way history with show_redactions --- test/controllers/old_ways_controller_test.rb | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/test/controllers/old_ways_controller_test.rb b/test/controllers/old_ways_controller_test.rb index 28c5ec1ca..1a0f81a52 100644 --- a/test/controllers/old_ways_controller_test.rb +++ b/test/controllers/old_ways_controller_test.rb @@ -17,6 +17,23 @@ class OldWaysControllerTest < ActionDispatch::IntegrationTest sidebar_browse_check :way_history_path, way.id, "old_elements/index" end + def test_index_show_redactions_to_unauthorized + way = create(:way, :with_history) + + get way_history_path(:id => way, :params => { :show_redactions => true }) + + assert_response :redirect + end + + def test_index_show_redactions_to_regular_user + way = create(:way, :with_history) + + session_for(create(:user)) + get way_history_path(:id => way, :params => { :show_redactions => true }) + + assert_response :redirect + end + def test_show way = create(:way, :with_history) -- 2.39.5