Sha256: f881681f4633b4fa0ae38942df436218aff8d691c48232585244de9d8ea067fd
Contents?: true
Size: 1.25 KB
Versions: 11
Compression:
Stored size: 1.25 KB
Contents
# frozen_string_literal: true RSpec.feature 'Admin - Sign In', type: :feature do background do @user = create(:user, email: 'email@person.com') visit spree.admin_login_path end scenario 'asks user to sign in' do visit spree.admin_path expect(page).not_to have_text 'Authorization Failure' end scenario 'lets a user sign in successfully' do fill_in 'Email', with: @user.email fill_in 'Password', with: 'secret' click_button 'Login' expect(page).to have_text 'Logged in successfully' expect(page).not_to have_text 'Login' expect(page).to have_text 'Logout' expect(current_path).to eq '/' end scenario 'shows validation erros' do fill_in 'Email', with: @user.email fill_in 'Password', with: 'wrong_password' click_button 'Login' expect(page).to have_text 'Invalid email or password' expect(page).to have_text 'Login' end scenario 'allows a user to access a restricted page after logging in' do user = create(:admin_user, email: 'admin@person.com') visit spree.admin_path fill_in 'Email', with: user.email fill_in 'Password', with: 'secret' click_button 'Login' expect(page).to have_text 'admin@person.com' expect(current_path).to eq '/admin/orders' end end
Version data entries
11 entries across 11 versions & 1 rubygems