From e7e16318d056dbd9ec272085487cce6039627b09 Mon Sep 17 00:00:00 2001 From: elijah Date: Sun, 31 Jan 2016 14:43:19 -0800 Subject: remove cert fingerprints for disabled users, so that they cannot send email anymore. closes #7690 --- test/functional/users_controller_test.rb | 2 +- test/functional/v1/certs_controller_test.rb | 8 +++++++- test/functional/v1/smtp_certs_controller_test.rb | 6 ++++++ 3 files changed, 14 insertions(+), 2 deletions(-) (limited to 'test/functional') diff --git a/test/functional/users_controller_test.rb b/test/functional/users_controller_test.rb index 70f483e..261f201 100644 --- a/test/functional/users_controller_test.rb +++ b/test/functional/users_controller_test.rb @@ -1,4 +1,4 @@ -require 'test_helper' +require_relative '../test_helper' class UsersControllerTest < ActionController::TestCase diff --git a/test/functional/v1/certs_controller_test.rb b/test/functional/v1/certs_controller_test.rb index ec34b01..04c1c86 100644 --- a/test/functional/v1/certs_controller_test.rb +++ b/test/functional/v1/certs_controller_test.rb @@ -1,4 +1,4 @@ -require 'test_helper' +require_relative '../../test_helper' class V1::CertsControllerTest < ActionController::TestCase @@ -21,6 +21,12 @@ class V1::CertsControllerTest < ActionController::TestCase end end + test "fail to create cert when disabled" do + login :enabled? => false + post :create + assert_access_denied + end + test "create unlimited cert" do login effective_service_level: ServiceLevel.new(id: 2) cert = expect_cert('UNLIMITED') diff --git a/test/functional/v1/smtp_certs_controller_test.rb b/test/functional/v1/smtp_certs_controller_test.rb index ba70410..1b03995 100644 --- a/test/functional/v1/smtp_certs_controller_test.rb +++ b/test/functional/v1/smtp_certs_controller_test.rb @@ -24,6 +24,12 @@ class V1::SmtpCertsControllerTest < ActionController::TestCase assert_equal cert.to_s, @response.body end + test "fail to create cert when disabled" do + login :enabled? => false + post :create + assert_access_denied + end + protected def expect_cert(email) -- cgit v1.2.3