summaryrefslogtreecommitdiff
path: root/certs/test
diff options
context:
space:
mode:
authorAzul <azul@leap.se>2013-02-25 12:35:00 +0100
committerAzul <azul@leap.se>2013-02-25 12:35:00 +0100
commita314d1265bcf7b0c6dd66d61d03e1d2a7545cfb8 (patch)
tree9a0d17f49b03cb1f79d97717def60353795124cb /certs/test
parent1023cac35016bb1a89864d10ac89acabe86cf227 (diff)
enable free certs in the controller
Diffstat (limited to 'certs/test')
-rw-r--r--certs/test/functional/certs_controller_test.rb10
1 files changed, 6 insertions, 4 deletions
diff --git a/certs/test/functional/certs_controller_test.rb b/certs/test/functional/certs_controller_test.rb
index 75256ca..6ebd08e 100644
--- a/certs/test/functional/certs_controller_test.rb
+++ b/certs/test/functional/certs_controller_test.rb
@@ -4,16 +4,18 @@ class CertsControllerTest < ActionController::TestCase
setup do
end
- test "should require login" do
+ test "should send free cert without login" do
+ cert = stub :cert => "free cert", :key => "key"
+ ClientCertificate.expects(:new).with(free: true).returns(cert)
get :show
- assert_response :redirect
- assert_redirected_to login_url
+ assert_response :success
+ assert_equal cert.key + cert.cert, @response.body
end
test "should send cert" do
login
cert = stub :cert => "adsf", :key => "key"
- ClientCertificate.expects(:new).returns(cert)
+ ClientCertificate.expects(:new).with(free: false).returns(cert)
get :show
assert_response :success
assert_equal cert.key + cert.cert, @response.body