summaryrefslogtreecommitdiff
path: root/test/integration/api
diff options
context:
space:
mode:
authorAzul <azul@leap.se>2014-05-26 09:31:36 +0200
committerAzul <azul@leap.se>2014-05-26 09:31:36 +0200
commit00d5adc90ccadc7f4a2a0d54a5a31a1ad02f05be (patch)
tree2e9655ed7597c3a9d7c520d04f5991d62e7b345b /test/integration/api
parent3a84578cf33685800c9216cfb4da12ea1fb0032f (diff)
change from GET to POST for certs
We create them. let's reflect that in the verb.
Diffstat (limited to 'test/integration/api')
-rw-r--r--test/integration/api/smtp_cert_test.rb10
1 files changed, 5 insertions, 5 deletions
diff --git a/test/integration/api/smtp_cert_test.rb b/test/integration/api/smtp_cert_test.rb
index 992249b..04e6f31 100644
--- a/test/integration/api/smtp_cert_test.rb
+++ b/test/integration/api/smtp_cert_test.rb
@@ -6,7 +6,7 @@ class SmtpCertTest < ApiIntegrationTest
test "retrieve smtp cert" do
@user = FactoryGirl.create :user, effective_service_level_code: 2
login
- get '/1/smtp_cert', {}, RACK_ENV
+ post '/1/smtp_cert', {}, RACK_ENV
assert_text_response
assert_response_includes "BEGIN RSA PRIVATE KEY"
assert_response_includes "END RSA PRIVATE KEY"
@@ -17,7 +17,7 @@ class SmtpCertTest < ApiIntegrationTest
test "cert and key" do
@user = FactoryGirl.create :user, effective_service_level_code: 2
login
- get '/1/smtp_cert', {}, RACK_ENV
+ post '/1/smtp_cert', {}, RACK_ENV
assert_text_response
cert = OpenSSL::X509::Certificate.new(get_response.body)
key = OpenSSL::PKey::RSA.new(get_response.body)
@@ -29,7 +29,7 @@ class SmtpCertTest < ApiIntegrationTest
test "fingerprint is stored with identity" do
@user = FactoryGirl.create :user, effective_service_level_code: 2
login
- get '/1/smtp_cert', {}, RACK_ENV
+ post '/1/smtp_cert', {}, RACK_ENV
assert_text_response
cert = OpenSSL::X509::Certificate.new(get_response.body)
fingerprint = OpenSSL::Digest::SHA1.hexdigest(cert.to_der).scan(/../).join(':')
@@ -39,13 +39,13 @@ class SmtpCertTest < ApiIntegrationTest
test "fetching smtp certs requires email account" do
login
- get '/1/smtp_cert', {}, RACK_ENV
+ post '/1/smtp_cert', {}, RACK_ENV
assert_json_response error: I18n.t(:not_authorized)
end
test "no anonymous smtp certs" do
with_config allow_anonymous_certs: true do
- get '/1/smtp_cert', {}, RACK_ENV
+ post '/1/smtp_cert', {}, RACK_ENV
assert_json_response error: I18n.t(:not_authorized)
end
end