Sha256: b413bdb7dc5ef9fa635bcd8b1179376214e3143654bc063727f5bcbb0460a03a

Contents?: true

Size: 558 Bytes

Versions: 10

Compression:

Stored size: 558 Bytes

Contents

RSpec.describe Spree::Admin::UserSessionsController, type: :controller do
  before { @request.env['devise.mapping'] = Devise.mappings[:spree_user] }

  describe '#authorization_failure' do
    subject { spree_get :authorization_failure }

    context 'user signed in' do
      before { allow(controller).to receive(:spree_current_user) { build_stubbed(:user) } }

      it { is_expected.to render_template 'authorization_failure' }
    end

    context 'user not signed in' do
      it { is_expected.to redirect_to spree.admin_login_path }
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
spree_auth_devise-4.0.1 spec/controllers/spree/admin/user_sessions_controller_spec.rb
spree_auth_devise-4.0.0 spec/controllers/spree/admin/user_sessions_controller_spec.rb
spree_auth_devise-4.0.0.rc2 spec/controllers/spree/admin/user_sessions_controller_spec.rb
spree_auth_devise-4.0.0.rc1 spec/controllers/spree/admin/user_sessions_controller_spec.rb
spree_auth_devise-3.5.2 spec/controllers/spree/admin/user_sessions_controller_spec.rb
spree_auth_devise-3.5.1 spec/controllers/spree/admin/user_sessions_controller_spec.rb
spree_auth_devise-3.5.0 spec/controllers/spree/admin/user_sessions_controller_spec.rb
spree_auth_devise-3.4.2 spec/controllers/spree/admin/user_sessions_controller_spec.rb
spree_auth_devise-3.4.1 spec/controllers/spree/admin/user_sessions_controller_spec.rb
spree_auth_devise-3.4.0 spec/controllers/spree/admin/user_sessions_controller_spec.rb