diff options
author | azul <azul@leap.se> | 2014-07-17 12:16:07 +0200 |
---|---|---|
committer | azul <azul@leap.se> | 2014-07-17 12:16:07 +0200 |
commit | ade74d8a9091ae607586d7b287a0579a2ee7af8e (patch) | |
tree | 74273b8ba7e35d0fb3c96aa79e63c93086d15146 /test/integration | |
parent | 952bc18e8333ca5c3e6e16f8059f84a1414d5f6f (diff) | |
parent | e86cccb4b89540f3bd403110d051b2723be781b9 (diff) |
Merge pull request #176 from azul/feature/api-authenticated-configs
API: Authenticated access to config settings
Diffstat (limited to 'test/integration')
-rw-r--r-- | test/integration/api/cert_test.rb | 2 | ||||
-rw-r--r-- | test/integration/api/login_test.rb | 2 | ||||
-rw-r--r-- | test/integration/api/smtp_cert_test.rb | 4 | ||||
-rw-r--r-- | test/integration/api/srp_test.rb | 1 | ||||
-rw-r--r-- | test/integration/api/update_account_test.rb | 2 |
5 files changed, 5 insertions, 6 deletions
diff --git a/test/integration/api/cert_test.rb b/test/integration/api/cert_test.rb index 74d439a..118fb9f 100644 --- a/test/integration/api/cert_test.rb +++ b/test/integration/api/cert_test.rb @@ -14,7 +14,7 @@ class CertTest < ApiIntegrationTest test "fetching certs requires login by default" do get '/1/cert', {}, RACK_ENV - assert_json_response error: I18n.t(:not_authorized) + assert_login_required end test "retrieve anonymous eip cert" do diff --git a/test/integration/api/login_test.rb b/test/integration/api/login_test.rb index 92d153f..f37639e 100644 --- a/test/integration/api/login_test.rb +++ b/test/integration/api/login_test.rb @@ -45,6 +45,6 @@ class LoginTest < SrpTest test "logout requires token" do authenticate logout(nil, {}) - assert_equal 422, last_response.status + assert_login_required end end diff --git a/test/integration/api/smtp_cert_test.rb b/test/integration/api/smtp_cert_test.rb index 7697e44..b1bfd43 100644 --- a/test/integration/api/smtp_cert_test.rb +++ b/test/integration/api/smtp_cert_test.rb @@ -42,13 +42,13 @@ class SmtpCertTest < ApiIntegrationTest test "fetching smtp certs requires email account" do login post '/1/smtp_cert', {}, RACK_ENV - assert_json_response error: I18n.t(:not_authorized) + assert_access_denied end test "no anonymous smtp certs" do with_config allow_anonymous_certs: true do post '/1/smtp_cert', {}, RACK_ENV - assert_json_response error: I18n.t(:not_authorized) + assert_login_required end end end diff --git a/test/integration/api/srp_test.rb b/test/integration/api/srp_test.rb index 26adc8c..946450e 100644 --- a/test/integration/api/srp_test.rb +++ b/test/integration/api/srp_test.rb @@ -1,5 +1,4 @@ class SrpTest < RackTest - include AssertResponses teardown do if @user diff --git a/test/integration/api/update_account_test.rb b/test/integration/api/update_account_test.rb index 63429e7..16bbb8c 100644 --- a/test/integration/api/update_account_test.rb +++ b/test/integration/api/update_account_test.rb @@ -16,7 +16,7 @@ class UpdateAccountTest < SrpTest authenticate put "http://api.lvh.me:3000/1/users/" + @user.id + '.json', user_params(password: "No! Verify me instead.") - assert_access_denied + assert_login_required end test "update password via api" do |