summaryrefslogtreecommitdiff
path: root/test/integration/api/smtp_cert_test.rb
diff options
context:
space:
mode:
authorAzul <azul@riseup.net>2016-08-18 11:00:16 +0200
committerAzul <azul@riseup.net>2016-08-19 11:15:31 +0200
commitfbad882075e745ab7afbe5f89c67544fb3c607c3 (patch)
treed55e4c4dd3a6612e04e0fd40e736c8b6d4342762 /test/integration/api/smtp_cert_test.rb
parent20bb76848b852bba9ab3c99b1c2a68464585bd56 (diff)
respond_to on a per controller basis
If you inherit respond to and call it again in your controller it will not overwrite the previous but add to it. Since we always have some exceptions from the rules it's probably easiest to be explicit in the controllers that require it themselves.
Diffstat (limited to 'test/integration/api/smtp_cert_test.rb')
-rw-r--r--test/integration/api/smtp_cert_test.rb12
1 files changed, 3 insertions, 9 deletions
diff --git a/test/integration/api/smtp_cert_test.rb b/test/integration/api/smtp_cert_test.rb
index 53382c1..3adddfd 100644
--- a/test/integration/api/smtp_cert_test.rb
+++ b/test/integration/api/smtp_cert_test.rb
@@ -3,13 +3,8 @@ require 'openssl'
class SmtpCertTest < ApiIntegrationTest
- setup do
- @testcode = InviteCode.new
- @testcode.save!
- end
-
test "retrieve smtp cert" do
- @user = FactoryGirl.create :user, effective_service_level_code: 2, :invite_code => @testcode.invite_code
+ @user = create_invited_user effective_service_level_code: 2
login
post smtp_cert_url, {}, RACK_ENV
assert_text_response
@@ -20,7 +15,7 @@ class SmtpCertTest < ApiIntegrationTest
end
test "cert and key" do
- @user = FactoryGirl.create :user, effective_service_level_code: 2, :invite_code => @testcode.invite_code
+ @user = create_invited_user effective_service_level_code: 2
login
post smtp_cert_url, {}, RACK_ENV
assert_text_response
@@ -32,7 +27,7 @@ class SmtpCertTest < ApiIntegrationTest
end
test "fingerprint is stored with identity" do
- @user = FactoryGirl.create :user, effective_service_level_code: 2, :invite_code => @testcode.invite_code
+ @user = create_invited_user effective_service_level_code: 2
login
post smtp_cert_url, {}, RACK_ENV
assert_text_response
@@ -46,7 +41,6 @@ class SmtpCertTest < ApiIntegrationTest
end
test "fetching smtp certs requires email account" do
-
login
post smtp_cert_url, {}, RACK_ENV
assert_access_denied