diff options
| author | Azul <azul@riseup.net> | 2016-05-01 10:55:33 -0300 | 
|---|---|---|
| committer | Azul <azul@riseup.net> | 2016-05-18 20:07:41 +0200 | 
| commit | e05a1b0f5ae40a2aa17976b3009cd563b8e4660a (patch) | |
| tree | 77774fd7e70211febaf3a15c6e3b3e7340843c11 /test/integration/api/smtp_cert_test.rb | |
| parent | a1b494e334406660a1f49fb7de9b043493809640 (diff) | |
api: allow version bumping - bump to 2
Diffstat (limited to 'test/integration/api/smtp_cert_test.rb')
| -rw-r--r-- | test/integration/api/smtp_cert_test.rb | 14 | 
1 files changed, 9 insertions, 5 deletions
diff --git a/test/integration/api/smtp_cert_test.rb b/test/integration/api/smtp_cert_test.rb index 681d509..53382c1 100644 --- a/test/integration/api/smtp_cert_test.rb +++ b/test/integration/api/smtp_cert_test.rb @@ -11,7 +11,7 @@ class SmtpCertTest < ApiIntegrationTest    test "retrieve smtp cert" do      @user = FactoryGirl.create :user, effective_service_level_code: 2, :invite_code => @testcode.invite_code      login -    post '/1/smtp_cert', {}, RACK_ENV +    post smtp_cert_url, {}, RACK_ENV      assert_text_response      assert_response_includes "BEGIN RSA PRIVATE KEY"      assert_response_includes "END RSA PRIVATE KEY" @@ -22,7 +22,7 @@ class SmtpCertTest < ApiIntegrationTest    test "cert and key" do      @user = FactoryGirl.create :user, effective_service_level_code: 2, :invite_code => @testcode.invite_code      login -    post '/1/smtp_cert', {}, RACK_ENV +    post smtp_cert_url, {}, RACK_ENV      assert_text_response      cert = OpenSSL::X509::Certificate.new(get_response.body)      key = OpenSSL::PKey::RSA.new(get_response.body) @@ -34,7 +34,7 @@ class SmtpCertTest < ApiIntegrationTest    test "fingerprint is stored with identity" do      @user = FactoryGirl.create :user, effective_service_level_code: 2, :invite_code => @testcode.invite_code      login -    post '/1/smtp_cert', {}, RACK_ENV +    post smtp_cert_url, {}, RACK_ENV      assert_text_response      cert = OpenSSL::X509::Certificate.new(get_response.body)      fingerprint = OpenSSL::Digest::SHA1.hexdigest(cert.to_der).scan(/../).join(':') @@ -48,14 +48,18 @@ class SmtpCertTest < ApiIntegrationTest    test "fetching smtp certs requires email account" do      login -    post '/1/smtp_cert', {}, RACK_ENV +    post smtp_cert_url, {}, RACK_ENV      assert_access_denied    end    test "no anonymous smtp certs" do      with_config allow_anonymous_certs: true do -      post '/1/smtp_cert', {}, RACK_ENV +      post smtp_cert_url, {}, RACK_ENV        assert_login_required      end    end + +  def smtp_cert_url +    "/#{api_version}/smtp_cert" +  end  end  | 
