Sha256: 150d1d3bcdfbd7ca9b8fca2827a23b4212587e0b7b36b222e629a251843cb7ef

Contents?: true

Size: 392 Bytes

Versions: 15

Compression:

Stored size: 392 Bytes

Contents

require 'spec_helper'

describe DashboardController, type: :controller do
  context 'when logged in' do
    before { logged_in }

    context 'and admin masquerade by user' do
      let!(:user) { create(:user) }

      before do
        user.masquerade!

        get :index, :masquerade => user.masquerade_key
      end

      it { expect(current_user.reload).to eq(user) }
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
devise_masquerade-0.6.5 spec/controllers/dashboard_controller_spec.rb
devise_masquerade-0.6.4 spec/controllers/dashboard_controller_spec.rb
devise_masquerade-0.6.3 spec/controllers/dashboard_controller_spec.rb
devise_masquerade-0.6.2 spec/controllers/dashboard_controller_spec.rb
devise_masquerade-0.6.1 spec/controllers/dashboard_controller_spec.rb
devise_masquerade-0.6.0 spec/controllers/dashboard_controller_spec.rb
devise_masquerade-0.5.3 spec/controllers/dashboard_controller_spec.rb
devise_masquerade-0.5.2 spec/controllers/dashboard_controller_spec.rb
devise_masquerade-0.5.1 spec/controllers/dashboard_controller_spec.rb
devise_masquerade-0.5.0 spec/controllers/dashboard_controller_spec.rb
devise_masquerade-0.4.0 spec/controllers/dashboard_controller_spec.rb
devise_masquerade-0.3.1 spec/controllers/dashboard_controller_spec.rb
devise_masquerade-0.3.0 spec/controllers/dashboard_controller_spec.rb
devise_masquerade-0.2.0 spec/controllers/dashboard_controller_spec.rb
devise_masquerade-0.1.8 spec/controllers/dashboard_controller_spec.rb