summaryrefslogtreecommitdiff
path: root/certs/test/functional/certs_controller_test.rb
blob: a579a009b01b5869fe0a49d400c71b03356da379 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
require 'test_helper'

class CertsControllerTest < ActionController::TestCase
  setup do
  end

  test "should send free cert without login" do
    cert = stub :to_s => "free cert"
    ClientCertificate.expects(:new).with(free: true).returns(cert)
    get :show
    assert_response :success
    assert_equal cert.to_s, @response.body
  end

  test "should send cert" do
    login
    cert = stub :to_s => "real cert"
    ClientCertificate.expects(:new).with(free: false).returns(cert)
    get :show
    assert_response :success
    assert_equal cert.to_s, @response.body
  end
end