Skip to content

Instantly share code, notes, and snippets.

@kenzotakahashi
Created July 30, 2016 01:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kenzotakahashi/9dce8fe5d2d75b3026c1895c1ae89159 to your computer and use it in GitHub Desktop.
Save kenzotakahashi/9dce8fe5d2d75b3026c1895c1ae89159 to your computer and use it in GitHub Desktop.
require 'rails_helper'
RSpec.describe "the signin process", :type => :feature do
# before :each do
# User.new(:email => 'user@example.com', :password => 'password')
# end
it "signs me in" do
visit '/login'
within(".row") do
fill_in 'session_email', :with => 'kenzotakahashi2@gmail.com'
fill_in 'session_password', :with => 'python'
end
click_button 'Log in'
# expect(page).to have_content 'Invalid'
expect(page).to have_content 'followers'
# expect(page).to have_content 'kenzotakahashi2@gmail.com'
end
it "does not sign me in" do
visit '/login'
within(".row") do
fill_in 'session[email]', :with => 'kenzotakahashi2@gmail.com'
fill_in 'session[password]', :with => ''
end
click_button 'Log in'
expect(page).to have_content 'Invalid'
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment