Sha256: e557a6f9de7016c64c6559ff270ac37411968631852f860be1d03255da801f48

Contents?: true

Size: 690 Bytes

Versions: 21

Compression:

Stored size: 690 Bytes

Contents

# frozen_string_literal: true

::RSpec.shared_context 'when user is non admin', shared_context: :metadata do
  let(:user) { ::FactoryBot.create(:non_admin_user) }

  before do
    visit '/users/sign_in'
    fill_in ::I18n.translate!('activerecord.attributes.eac_users_support/user.email'),
            with: user.email
    fill_in ::I18n.translate!('activerecord.attributes.eac_users_support/user.password'),
            with: user.password
    click_button ::I18n.translate!('devise.log_in')
  end

  it 'user should be logged' do
    expect(page).to have_content user.email
  end

  it 'should be a link to logout' do
    expect(page).to have_link(nil, href: '/users/sign_out')
  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
eac_rails_base0-0.68.0 lib/eac_rails_base0/rspec/shared_contexts/when_user_is_non_admin.rb
eac_rails_base0-0.67.0 lib/eac_rails_base0/rspec/shared_contexts/when_user_is_non_admin.rb
eac_rails_base0-0.66.0 lib/eac_rails_base0/rspec/shared_contexts/when_user_is_non_admin.rb
eac_rails_base0-0.65.0 lib/eac_rails_base0/rspec/shared_contexts/when_user_is_non_admin.rb
eac_rails_base0-0.64.0 lib/eac_rails_base0/rspec/shared_contexts/when_user_is_non_admin.rb
eac_rails_base0-0.63.1 lib/eac_rails_base0/rspec/shared_contexts/when_user_is_non_admin.rb
eac_rails_base0-0.63.0 lib/eac_rails_base0/rspec/shared_contexts/when_user_is_non_admin.rb
eac_rails_base0-0.62.0 lib/eac_rails_base0/rspec/shared_contexts/when_user_is_non_admin.rb
eac_rails_base0-0.61.1 lib/eac_rails_base0/rspec/shared_contexts/when_user_is_non_admin.rb
eac_rails_base0-0.61.0 lib/eac_rails_base0/rspec/shared_contexts/when_user_is_non_admin.rb
eac_rails_base0-0.60.4 lib/eac_rails_base0/rspec/shared_contexts/when_user_is_non_admin.rb
eac_rails_base0-0.60.3 lib/eac_rails_base0/rspec/shared_contexts/when_user_is_non_admin.rb
eac_rails_base0-0.60.2 lib/eac_rails_base0/rspec/shared_contexts/when_user_is_non_admin.rb
eac_rails_base0-0.60.1 lib/eac_rails_base0/rspec/shared_contexts/when_user_is_non_admin.rb
eac_rails_base0-0.60.0 lib/eac_rails_base0/rspec/shared_contexts/when_user_is_non_admin.rb
eac_rails_base0-0.59.0 lib/eac_rails_base0/rspec/shared_contexts/when_user_is_non_admin.rb
eac_rails_base0-0.58.0 lib/eac_rails_base0/rspec/shared_contexts/when_user_is_non_admin.rb
eac_rails_base0-0.57.0 lib/eac_rails_base0/rspec/shared_contexts/when_user_is_non_admin.rb
eac_rails_base0-0.56.0 lib/eac_rails_base0/rspec/shared_contexts/when_user_is_non_admin.rb
eac_rails_base0-0.55.3 lib/eac_rails_base0/rspec/shared_contexts/when_user_is_non_admin.rb