Sha256: 43f9313acac21ee12b76e720a353f64b0b7153e0cba051c542b0c4f93ed0ba3e

Contents?: true

Size: 1.17 KB

Versions: 15

Compression:

Stored size: 1.17 KB

Contents

require 'spec_helper'

describe CASino::TwoFactorAuthenticatorsController do
  describe 'GET "new"' do
    it 'calls the process method of the TwoFactorAuthenticatorRegistrator' do
      CASino::TwoFactorAuthenticatorRegistratorProcessor.any_instance.should_receive(:process)
      get :new, use_route: :casino
    end
  end

  describe 'POST "create"' do
    it 'calls the process method of the TwoFactorAuthenticatorActivator' do
      CASino::TwoFactorAuthenticatorActivatorProcessor.any_instance.should_receive(:process) do
        @controller.render nothing: true
      end
      post :create, use_route: :casino
    end
  end

  describe 'DELETE "destroy"' do
    let(:id) { '123' }
    let(:tgt) { 'TGT-foobar' }
    it 'calls the process method of the TwoFactorAuthenticatorDestroyer processor' do
      request.cookies[:tgt] = tgt
      CASino::TwoFactorAuthenticatorDestroyerProcessor.any_instance.should_receive(:process) do |params, cookies, user_agent|
        params[:id].should == id
        cookies[:tgt].should == tgt
        user_agent.should == request.user_agent
        @controller.render nothing: true
      end
      delete :destroy, id:id, use_route: :casino
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
casino-3.0.4 spec/controllers/two_factor_authenticators_controller_spec.rb
casino-2.0.7 spec/controllers/two_factor_authenticators_controller_spec.rb
casino-3.0.3 spec/controllers/two_factor_authenticators_controller_spec.rb
casino-3.0.2 spec/controllers/two_factor_authenticators_controller_spec.rb
casino-3.0.1 spec/controllers/two_factor_authenticators_controller_spec.rb
casino-3.0.0 spec/controllers/two_factor_authenticators_controller_spec.rb
casino-3.0.0.pre.2 spec/controllers/two_factor_authenticators_controller_spec.rb
casino-3.0.0.pre.1 spec/controllers/two_factor_authenticators_controller_spec.rb
casino-2.0.6 spec/controllers/two_factor_authenticators_controller_spec.rb
casino-2.0.5 spec/controllers/two_factor_authenticators_controller_spec.rb
casino-2.0.4 spec/controllers/two_factor_authenticators_controller_spec.rb
casino-2.0.3 spec/controllers/two_factor_authenticators_controller_spec.rb
casino-2.0.2 spec/controllers/two_factor_authenticators_controller_spec.rb
casino-2.0.1 spec/controllers/two_factor_authenticators_controller_spec.rb
casino-2.0.0 spec/controllers/two_factor_authenticators_controller_spec.rb