Skip to content

Instantly share code, notes, and snippets.

@ariera
Created September 12, 2014 09:30
Show Gist options
  • Save ariera/3b746c4facbed3c6dc5c to your computer and use it in GitHub Desktop.
Save ariera/3b746c4facbed3c6dc5c to your computer and use it in GitHub Desktop.
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