From f221e5313fe54a2efa127b547916c7c812110449 Mon Sep 17 00:00:00 2001 From: Azul Date: Mon, 26 May 2014 09:56:11 +0200 Subject: fix test to require login --- test/functional/v1/smtp_certs_controller_test.rb | 2 +- test/support/auth_test_helper.rb | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/test/functional/v1/smtp_certs_controller_test.rb b/test/functional/v1/smtp_certs_controller_test.rb index ae1a214..9281ae6 100644 --- a/test/functional/v1/smtp_certs_controller_test.rb +++ b/test/functional/v1/smtp_certs_controller_test.rb @@ -5,7 +5,7 @@ class V1::SmtpCertsControllerTest < ActionController::TestCase test "no smtp cert without login" do with_config allow_anonymous_certs: true do post :create - assert_access_denied + assert_login_required end end diff --git a/test/support/auth_test_helper.rb b/test/support/auth_test_helper.rb index 57f9f9b..e1961aa 100644 --- a/test/support/auth_test_helper.rb +++ b/test/support/auth_test_helper.rb @@ -19,6 +19,10 @@ module AuthTestHelper return @current_user end + def assert_login_required + assert_access_denied(true, false) + end + def assert_access_denied(denied = true, logged_in = true) if denied if @response.content_type == 'application/json' -- cgit v1.2.3