summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAzul <azul@leap.se>2014-05-26 09:56:11 +0200
committerAzul <azul@leap.se>2014-05-26 09:56:11 +0200
commitf221e5313fe54a2efa127b547916c7c812110449 (patch)
treebd5dfd8997cc4c19f093573acdd68b66e1935b0f
parent00d5adc90ccadc7f4a2a0d54a5a31a1ad02f05be (diff)
fix test to require login
-rw-r--r--test/functional/v1/smtp_certs_controller_test.rb2
-rw-r--r--test/support/auth_test_helper.rb4
2 files changed, 5 insertions, 1 deletions
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'