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

class CertsControllerTest < ActionController::TestCase
  setup do
  end

  test "should require login" do
    get :show
    assert_response :redirect
    assert_redirected_to login_url
  end

  test "should send cert" do
    login
    cert = stub :cert => "adsf", :key => "key"
    LeapCA::Cert.expects(:pick_from_pool).returns(cert)
    get :show
    assert_response :success
    assert_equal cert.key + cert.cert, @response.body
  end
end