From e8a3df62d14c8dd775811f4af885cf7e76d5d3f6 Mon Sep 17 00:00:00 2001 From: Azul Date: Thu, 17 Jul 2014 11:18:57 +0200 Subject: clean up error assertions in tests We're not testing the redirects anymore. But the error messages should be pretty clear already. We can start testing redirects again once we redirect to different places for different actions. --- test/support/auth_test_helper.rb | 20 -------------------- 1 file changed, 20 deletions(-) (limited to 'test/support/auth_test_helper.rb') diff --git a/test/support/auth_test_helper.rb b/test/support/auth_test_helper.rb index 79d07d6..7af3341 100644 --- a/test/support/auth_test_helper.rb +++ b/test/support/auth_test_helper.rb @@ -19,26 +19,6 @@ module AuthTestHelper return @current_user end - def assert_login_required - assert_error_response :not_authorized_login, :unauthorized, login_url - end - - def assert_access_denied - assert_error_response :not_authorized, :forbidden, home_url - end - - def assert_error_response(message, status=nil, redirect=nil) - message = I18n.t(message) if message.is_a? Symbol - if @response.content_type == 'application/json' - status ||= :unprocessable_entity - assert_json_response('error' => message) - assert_response status - else - assert_equal({:alert => message}, flash.to_hash) - assert_redirected_to redirect - end - end - def assert_access_granted assert flash[:alert].blank?, "expected to have access but there was a flash alert" -- cgit v1.2.3