summaryrefslogtreecommitdiff
path: root/test/functional/api
diff options
context:
space:
mode:
authorazul <azul@riseup.net>2017-11-07 22:58:09 -0800
committerazul <azul@riseup.net>2017-11-07 22:58:09 -0800
commite7dfe732599df8df4299c60d14f7c1e3e112b27d (patch)
treeb48d01737e18f708b15d178bbe51ea95d8d6e3db /test/functional/api
parentd717aba320abc5cc2ebf5650cbd52a69a56926b5 (diff)
parentef91e8fe1fb5c1cf8f2f84fd25ef2b115f0ec8c8 (diff)
Merge branch '8800-hand-out-configs-json-without-authentication' into 'master'
feat: allow unauthenticated access to list of configs Closes #8800 See merge request leap/webapp!45
Diffstat (limited to 'test/functional/api')
-rw-r--r--test/functional/api/token_auth_test.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/test/functional/api/token_auth_test.rb b/test/functional/api/token_auth_test.rb
index c7f91c7..d6731a1 100644
--- a/test/functional/api/token_auth_test.rb
+++ b/test/functional/api/token_auth_test.rb
@@ -6,12 +6,12 @@
require 'test_helper'
class Api::TokenAuthTest < ApiControllerTest
- tests Api::ConfigsController
+ tests Api::ServicesController
def test_login_via_api_token
with_config(:allow_anonymous_certs => false) do
monitor_auth do
- api_get :index
+ api_get :show
assert assigns(:token), 'should have authenticated via api token'
assert assigns(:token).is_a? ApiToken
assert @controller.send(:current_user).is_a? ApiMonitorUser
@@ -26,10 +26,10 @@ class Api::TokenAuthTest < ApiControllerTest
with_config(new_config) do
monitor_auth do
request.env['REMOTE_ADDR'] = "1.1.1.1"
- api_get :index
+ api_get :show
assert_nil assigns(:token), "should not be able to auth with api token when ip restriction doesn't allow it"
request.env['REMOTE_ADDR'] = allowed
- api_get :index
+ api_get :show
assert assigns(:token), "should have authenticated via api token"
end
end