Skip to content

Instantly share code, notes, and snippets.

@tiagodavi
Last active August 29, 2015 14:17
Show Gist options
  • Save tiagodavi/e29a6760516ad61c317b to your computer and use it in GitHub Desktop.
Save tiagodavi/e29a6760516ad61c317b to your computer and use it in GitHub Desktop.
Capybara passes with rack_test, but don't passes with selenium. Wtf?
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