Skip to content

Instantly share code, notes, and snippets.

@kenzotakahashi
Created July 30, 2016 01:09
Show Gist options
  • 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 => '[email protected]', :password => 'password')
# end
it "signs me in" do
visit '/login'
within(".row") do
fill_in 'session_email', :with => '[email protected]'
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 '[email protected]'
end
it "does not sign me in" do
visit '/login'
within(".row") do
fill_in 'session[email]', :with => '[email protected]'
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