Created
November 7, 2012 06:57
-
-
Save xirukitepe/4029912 to your computer and use it in GitHub Desktop.
Example test with capybara and factory girl
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
describe "home page" do | |
it "displays the user's username after successful login" do | |
user = FactoryGirl.create(:user, :username => "jdoe", :password => "secret") | |
visit "/login" | |
fill_in "Username", :with => "jdoe" | |
fill_in "Password", :with => "secret" | |
click_button "Log in" | |
page.should have_selector(".header .username", :text => "jdoe") | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment