Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- require 'rails_helper'
- RSpec.describe 'home page', type: :request do
- it 'displays the users username after successful login, hide after logout' do
- user = FactoryGirl.build(:user)
- user.save
- visit '/login'
- fill_in 'session_email', with: user.email
- fill_in 'session_password', with: 'swordfish'
- click_button 'Login'
- expect(page).to have_content user.name
- click_link 'Logout'
- expect(page).not_to have_content user.name
- end
- end
Add Comment
Please, Sign In to add comment