Sha256: 3f952227cb03ba956237ad47890d7c007b4f039e6c45172bac809ceb03763386

Contents?: true

Size: 679 Bytes

Versions: 3

Compression:

Stored size: 679 Bytes

Contents

RSpec.describe Dashing::ApplicationController do

  describe '#authentication_with_devise' do

    let(:models) { [:user, :admin] }
    let!(:devise_instances) do
      module DeviseInstances
        def authenticate_user!; end
        def authenticate_admin!; end
      end
    end

    before do
      controller.extend(DeviseInstances)
      allow(Dashing).to receive_message_chain(:config, :devise_allowed_models).and_return(models)
    end

    it 'calls devise authenticate method' do
      expect(controller).to receive("authenticate_user!")
      expect(controller).to receive("authenticate_admin!")
      controller.send(:authentication_with_devise)
    end

  end

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
dashing-rails-2.6.2 spec/controllers/dashing/application_controller_spec.rb
dashing-rails-2.6.1 spec/controllers/dashing/application_controller_spec.rb
dashing-rails-2.6.0 spec/controllers/dashing/application_controller_spec.rb