X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/6ca22de4f2c68e4b14a6e2f0938a8657c33adc31..e219916dcbb00fe179d27a3c1b32139c511f9c2e:/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 4371e3f82..326f2335a 100644 --- a/test/controllers/user_blocks_controller_test.rb +++ b/test/controllers/user_blocks_controller_test.rb @@ -145,7 +145,8 @@ 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_response :forbidden + assert_response :redirect + assert_redirected_to :controller => "errors", :action => "forbidden" # Login as a moderator session[:user] = create(:moderator_user).id @@ -188,7 +189,8 @@ class UserBlocksControllerTest < ActionController::TestCase # Check that normal users can't load the block edit page get :edit, :params => { :id => active_block.id } - assert_response :forbidden + assert_response :redirect + assert_redirected_to :controller => "errors", :action => "forbidden" # Login as a moderator session[:user] = create(:moderator_user).id @@ -230,7 +232,8 @@ class UserBlocksControllerTest < ActionController::TestCase # Check that normal users can't create blocks post :create - assert_response :forbidden + assert_response :redirect + assert_redirected_to :controller => "errors", :action => "forbidden" # Login as a moderator session[:user] = moderator_user.id @@ -292,7 +295,8 @@ class UserBlocksControllerTest < ActionController::TestCase # Check that normal users can't update blocks put :update, :params => { :id => active_block.id } - assert_response :forbidden + assert_response :redirect + assert_redirected_to :controller => "errors", :action => "forbidden" # Login as the wrong moderator session[:user] = second_moderator_user.id @@ -359,7 +363,8 @@ class UserBlocksControllerTest < ActionController::TestCase # Check that normal users can't load the block revoke page get :revoke, :params => { :id => active_block.id } - assert_response :forbidden + assert_response :redirect + assert_redirected_to :controller => "errors", :action => "forbidden" # Login as a moderator session[:user] = create(:moderator_user).id