Last active
August 29, 2015 14:17
-
-
Save tiagodavi/e29a6760516ad61c317b to your computer and use it in GitHub Desktop.
Capybara passes with rack_test, but don't passes with selenium. Wtf?
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 'rails_helper' | |
feature "Login" do | |
background do | |
#Factory Girl | |
@user = create(:user) | |
end | |
scenario "With correct credentials" do | |
visit '/signup' | |
fill_in 'user_session_login', :with => @user.login | |
fill_in 'user_session_password', :with => @user.password | |
click_button 'Entrar' | |
expect(page).to have_content 'John' | |
expect(page).to have_content '@john' | |
end | |
scenario "With incorrect credentials" do | |
visit '/signup' | |
fill_in 'user_session_login', :with => 'foo' | |
fill_in 'user_session_password', :with => 'bar' | |
click_button 'Entrar' | |
expect(page).to have_content 'Login Inválido' | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment