X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/25f27a753f6a79bc1ae494e42cf03b9880d0bdcd..79207ee5948a11f920d90c9bdaba394bc4316115:/test/controllers/user_blocks_controller_test.rb diff --git a/test/controllers/user_blocks_controller_test.rb b/test/controllers/user_blocks_controller_test.rb index 77b17519e..4371e3f82 100644 --- a/test/controllers/user_blocks_controller_test.rb +++ b/test/controllers/user_blocks_controller_test.rb @@ -145,8 +145,7 @@ class UserBlocksControllerTest < ActionController::TestCase # Check that normal users can't load the block creation page get :new, :params => { :display_name => target_user.display_name } - assert_redirected_to user_blocks_path - assert_equal "You need to be a moderator to perform that action.", flash[:error] + assert_response :forbidden # Login as a moderator session[:user] = create(:moderator_user).id @@ -189,8 +188,7 @@ class UserBlocksControllerTest < ActionController::TestCase # Check that normal users can't load the block edit page get :edit, :params => { :id => active_block.id } - assert_redirected_to user_blocks_path - assert_equal "You need to be a moderator to perform that action.", flash[:error] + assert_response :forbidden # Login as a moderator session[:user] = create(:moderator_user).id @@ -361,8 +359,7 @@ class UserBlocksControllerTest < ActionController::TestCase # Check that normal users can't load the block revoke page get :revoke, :params => { :id => active_block.id } - assert_redirected_to user_blocks_path - assert_equal "You need to be a moderator to perform that action.", flash[:error] + assert_response :forbidden # Login as a moderator session[:user] = create(:moderator_user).id