summaryrefslogtreecommitdiff
path: root/test/support/auth_test_helper.rb
diff options
context:
space:
mode:
authorAzul <azul@leap.se>2014-07-17 11:18:57 +0200
committerAzul <azul@leap.se>2014-07-17 11:18:57 +0200
commite8a3df62d14c8dd775811f4af885cf7e76d5d3f6 (patch)
tree99905fc826fbcdf0634be3b31945e6df8c7e7a1e /test/support/auth_test_helper.rb
parentbb10a669e1129c662ba01f223bd5a0ee7f2a0344 (diff)
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.
Diffstat (limited to 'test/support/auth_test_helper.rb')
-rw-r--r--test/support/auth_test_helper.rb20
1 files changed, 0 insertions, 20 deletions
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"