Sha256: b5e0f0831989068df7ea24dd186722c84152dee4891e8af96a352fc4bdbac80b

Contents?: true

Size: 680 Bytes

Versions: 8

Compression:

Stored size: 680 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

8 entries across 8 versions & 1 rubygems

Version Path
eac_rails_base0-0.69.0 lib/eac_rails_base0/rspec/shared_contexts/when_user_is_non_admin.rb
eac_rails_base0-0.68.7 lib/eac_rails_base0/rspec/shared_contexts/when_user_is_non_admin.rb
eac_rails_base0-0.68.6 lib/eac_rails_base0/rspec/shared_contexts/when_user_is_non_admin.rb
eac_rails_base0-0.68.5 lib/eac_rails_base0/rspec/shared_contexts/when_user_is_non_admin.rb
eac_rails_base0-0.68.4 lib/eac_rails_base0/rspec/shared_contexts/when_user_is_non_admin.rb
eac_rails_base0-0.68.3 lib/eac_rails_base0/rspec/shared_contexts/when_user_is_non_admin.rb
eac_rails_base0-0.68.2 lib/eac_rails_base0/rspec/shared_contexts/when_user_is_non_admin.rb
eac_rails_base0-0.68.1 lib/eac_rails_base0/rspec/shared_contexts/when_user_is_non_admin.rb