summaryrefslogtreecommitdiff
path: root/test/functional/api/services_controller_test.rb
diff options
context:
space:
mode:
authorAzul <azul@riseup.net>2016-05-18 21:00:42 +0200
committerAzul <azul@riseup.net>2016-05-20 16:35:55 +0200
commite542a3056c27fd662ef767b6720861035f6dbb1c (patch)
tree45d0d16069a7820a58583423956c8cc4f5f64819 /test/functional/api/services_controller_test.rb
parent83f59164fc069f2593cf6babbc18638d9a68c9a3 (diff)
api: set defaults for version in routes
This way we do not need to specify it all the times. In the functional tests defaults do not get added automatically. Introduced api_{get,put,post,delete} to add format and version default. One to two functional tests failing, everything else passes.
Diffstat (limited to 'test/functional/api/services_controller_test.rb')
-rw-r--r--test/functional/api/services_controller_test.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/test/functional/api/services_controller_test.rb b/test/functional/api/services_controller_test.rb
index b1dc9f3..cb85edf 100644
--- a/test/functional/api/services_controller_test.rb
+++ b/test/functional/api/services_controller_test.rb
@@ -1,16 +1,16 @@
require 'test_helper'
-class Api::ServicesControllerTest < ActionController::TestCase
+class Api::ServicesControllerTest < ApiControllerTest
test "anonymous user gets login required service info" do
- get :show, format: :json
+ api_get :show, format: :json
assert_json_response error: 'not_authorized_login',
message: 'Please log in to perform that action.'
end
test "anonymous user gets vpn service info" do
with_config allow_anonymous_certs: true do
- get :show, format: :json
+ api_get :show, format: :json
assert_json_response name: 'anonymous',
eip_rate_limit: false,
description: 'anonymous access to the VPN'
@@ -19,7 +19,7 @@ class Api::ServicesControllerTest < ActionController::TestCase
test "user can see their service info" do
login
- get :show, format: :json
+ api_get :show, format: :json
default_level = APP_CONFIG[:default_service_level]
assert_json_response APP_CONFIG[:service_levels][default_level]
end