Sha256: f00a26ef01471fc9f72435099bd77098e331038f20d3ba8f34b5d7c390bff58c

Contents?: true

Size: 308 Bytes

Versions: 3

Compression:

Stored size: 308 Bytes

Contents

shared_examples 'requires authorization' do
  let(:user) {create :user}
  before do
    sign_out admin_user
    sign_in user
    action
  end

  it 'redirects to root path' do
    expect(response).to redirect_to root_path
  end

  it 'sets flash[:alert]' do
    expect(flash[:alert]).to_not be_nil
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
myrails-7.0.0 lib/myrails/templates/spec/support/shared_examples/requires_authorization.rb
myrails-6.0.0 lib/myrails/templates/spec/support/shared_examples/requires_authorization.rb
myrails-5.0.0 lib/myrails/templates/spec/support/shared_examples/requires_authorization.rb