2017-04-14 23:21:02 +00:00
|
|
|
require "rails_helper"
|
|
|
|
|
|
|
|
feature "Log in" do
|
2017-05-31 15:09:17 +00:00
|
|
|
given(:email) { "test@examle.com" }
|
|
|
|
given(:password) { "password" }
|
|
|
|
|
|
|
|
background do
|
2017-04-14 23:21:02 +00:00
|
|
|
Fabricate(:user, email: email, password: password)
|
2017-05-31 15:09:17 +00:00
|
|
|
end
|
2017-04-14 23:21:02 +00:00
|
|
|
|
2017-05-31 15:09:17 +00:00
|
|
|
scenario "A valid email and password user is able to log in" do
|
2017-04-14 23:21:02 +00:00
|
|
|
visit new_user_session_path
|
|
|
|
fill_in "user_email", with: email
|
|
|
|
fill_in "user_password", with: password
|
|
|
|
click_on "Log in"
|
|
|
|
|
2017-05-03 00:04:16 +00:00
|
|
|
expect(page).to have_css "div.app-holder"
|
2017-04-14 23:21:02 +00:00
|
|
|
end
|
|
|
|
end
|