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