Sha256: f97c04230d7fc869f95ae9e53c76bbcc5800bb7eb1f3d0b4d49b96516e40bd38

Contents?: true

Size: 550 Bytes

Versions: 3

Compression:

Stored size: 550 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.after_sign_in_path).to eq('/')
      end

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

        expect(controller.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.1.2 spec/foyer/omniauth_callbacks_controller_spec.rb
foyer-0.1.1 spec/foyer/omniauth_callbacks_controller_spec.rb
foyer-0.1.0 spec/foyer/omniauth_callbacks_controller_spec.rb