Sha256: bc72e0644c4d9777c598f41d4e9da607e2aeceb229bb3d93d2eef436693c0a0d

Contents?: true

Size: 282 Bytes

Versions: 3

Compression:

Stored size: 282 Bytes

Contents

shared_examples 'requires authentication' do
  before do
    sign_out admin_user
    action
  end

  it 'redirects to new session path' do
    expect(response).to redirect_to new_user_session_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_authentication.rb
myrails-6.0.0 lib/myrails/templates/spec/support/shared_examples/requires_authentication.rb
myrails-5.0.0 lib/myrails/templates/spec/support/shared_examples/requires_authentication.rb