Sha256: 4e7622edf2ad7323dac9fd257fede82601e16f3fc26f1452dee4365aa7eade57

Contents?: true

Size: 563 Bytes

Versions: 3

Compression:

Stored size: 563 Bytes

Contents

require 'spec_helper'

module Foyer
  describe OmniauthCallbacksController, type: :controller do
    describe '#after_sign_in_path' do
      before do
        allow(controller).to receive(:root_path).and_return '/'
      end

      it 'defaults to root path' do
        expect(controller.send(:after_sign_in_path)).to eq('/')
      end

      it 'returns omniauth.origin if available' do
        origin = '/some_path'
        @request.env['omniauth.origin'] = origin

        expect(controller.send(:after_sign_in_path)).to eq(origin)
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
foyer-0.5.0 spec/foyer/omniauth_callbacks_controller_spec.rb
foyer-0.4.0 spec/foyer/omniauth_callbacks_controller_spec.rb
foyer-0.3.1 spec/foyer/omniauth_callbacks_controller_spec.rb