summaryrefslogtreecommitdiff
path: root/test/functional
diff options
context:
space:
mode:
authorAzul <azul@leap.se>2014-04-17 11:42:13 +0200
committerAzul <azul@leap.se>2014-04-17 11:42:13 +0200
commit8cc5ba134f6c5a1a06d91407aa78b962545c54ac (patch)
tree889e33e956ff52bb9246ae1e866b4ba131d20bae /test/functional
parent3513ad74f950b113af1ba1e3d06bc6a55c48fde5 (diff)
initial commit for the service level api
:api/service will return a hash of the current users service level This is failiing if the user is not logged in. Instead it should return the service description for an anonymous user.
Diffstat (limited to 'test/functional')
-rw-r--r--test/functional/v1/services_controller_test.rb23
1 files changed, 23 insertions, 0 deletions
diff --git a/test/functional/v1/services_controller_test.rb b/test/functional/v1/services_controller_test.rb
new file mode 100644
index 0000000..35a9de6
--- /dev/null
+++ b/test/functional/v1/services_controller_test.rb
@@ -0,0 +1,23 @@
+require 'test_helper'
+
+class V1::ServicesControllerTest < ActionController::TestCase
+
+ test "anonymous user can request service info" do
+ get :show, format: :json
+ assert_json_response name: 'anonymous',
+ cert_prefix: 'LIMITED',
+ description: 'anonymous account, with rate limited VPN'
+ end
+
+ test "user can see their service info" do
+ login
+ get :show, format: :json
+ assert_json_response name: 'free',
+ cert_prefix: 'LIMITED',
+ description: 'free account, with rate limited VPN',
+ cost: 0,
+ quota: 100
+ end
+
+end
+