Sha256: 3ae3b17278293e7ea2101407d413c8af7dd6ec679ea799fe4124fab478ec86d7
Contents?: true
Size: 783 Bytes
Versions: 7
Compression:
Stored size: 783 Bytes
Contents
require 'spec_helper' describe SimpleTokenAuthentication::FallbackAuthenticationHandler do it_behaves_like 'an authentication handler' describe '#authenticate_entity!' do it 'delegates authentication to Devise::Controllers::Helpers through a controller', private: true do controller = double() allow(controller).to receive(:authenticate_user!).and_return('Devise response.') entity = double() allow(entity).to receive_message_chain(:name_underscore).and_return('user') # delegating consists in sending the message expect(controller).to receive(:authenticate_user!) response = subject.authenticate_entity!(controller, entity) # and returning the response expect(response).to eq 'Devise response.' end end end
Version data entries
7 entries across 7 versions & 2 rubygems