Created
September 12, 2014 09:30
-
-
Save ariera/3b746c4facbed3c6dc5c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'spec_helper' | |
describe "User" do | |
it "should be able to log in", js:true do | |
user = create(:user, :with_subscription, :with_customer_info, :with_user_data) | |
visit new_user_session_path | |
within ".login_form" do | |
fill_in "user_login", :with => user.email | |
fill_in "user_password", :with => 'myawesomepassword' | |
click_button "Log In" | |
end | |
# If the global header has the user name displayed with a "logout" button then we successfully logged in | |
find("#global_header").click_link(user.name) | |
expect(page).to have_content("Logout") | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment