summaryrefslogtreecommitdiff
path: root/test/functional/v1/certs_controller_test.rb
diff options
context:
space:
mode:
authorAzul <azul@leap.se>2014-05-26 09:31:36 +0200
committerAzul <azul@leap.se>2014-05-26 09:31:36 +0200
commit00d5adc90ccadc7f4a2a0d54a5a31a1ad02f05be (patch)
tree2e9655ed7597c3a9d7c520d04f5991d62e7b345b /test/functional/v1/certs_controller_test.rb
parent3a84578cf33685800c9216cfb4da12ea1fb0032f (diff)
change from GET to POST for certs
We create them. let's reflect that in the verb.
Diffstat (limited to 'test/functional/v1/certs_controller_test.rb')
-rw-r--r--test/functional/v1/certs_controller_test.rb20
1 files changed, 14 insertions, 6 deletions
diff --git a/test/functional/v1/certs_controller_test.rb b/test/functional/v1/certs_controller_test.rb
index fb8e9c4..ec34b01 100644
--- a/test/functional/v1/certs_controller_test.rb
+++ b/test/functional/v1/certs_controller_test.rb
@@ -2,26 +2,34 @@ require 'test_helper'
class V1::CertsControllerTest < ActionController::TestCase
- test "send unlimited cert without login" do
+ test "create unlimited cert without login" do
with_config allow_anonymous_certs: true do
cert = expect_cert('UNLIMITED')
- get :show
+ post :create
assert_response :success
assert_equal cert.to_s, @response.body
end
end
- test "send limited cert" do
+ test "create limited cert" do
with_config allow_limited_certs: true do
login
cert = expect_cert('LIMITED')
- get :show
+ post :create
assert_response :success
assert_equal cert.to_s, @response.body
end
end
- test "send unlimited cert" do
+ test "create unlimited cert" do
+ login effective_service_level: ServiceLevel.new(id: 2)
+ cert = expect_cert('UNLIMITED')
+ post :create
+ assert_response :success
+ assert_equal cert.to_s, @response.body
+ end
+
+ test "GET still works as an alias" do
login effective_service_level: ServiceLevel.new(id: 2)
cert = expect_cert('UNLIMITED')
get :show
@@ -30,7 +38,7 @@ class V1::CertsControllerTest < ActionController::TestCase
end
test "redirect if no eip service offered" do
- get :show
+ post :create
assert_response :redirect
end