2015-05-01 11:18:41 +00:00

19 lines
424 B
Ruby

feature 'User sign in' do
scenario 'redirects to the home page when not signed in' do
visit root_path
expect(current_path).to eq new_session_path
end
scenario 'signs the user in' do
user = FactoryGirl.create(:user)
visit new_session_path
fill_in 'Email', with: user.email
fill_in 'Password', with: user.password
click_button 'Sign in'
expect(current_path).to eq root_path
end
end