summaryrefslogtreecommitdiff
path: root/test/functional/v1
diff options
context:
space:
mode:
Diffstat (limited to 'test/functional/v1')
-rw-r--r--test/functional/v1/certs_controller_test.rb8
-rw-r--r--test/functional/v1/smtp_certs_controller_test.rb6
2 files changed, 13 insertions, 1 deletions
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)