Skip to content

Instantly share code, notes, and snippets.

@mkdynamic
Created May 10, 2009 13:30
Show Gist options
  • Save mkdynamic/109615 to your computer and use it in GitHub Desktop.
Save mkdynamic/109615 to your computer and use it in GitHub Desktop.
Abandon Cucumber for projects where *I am* the client!
require 'test_helper'
class SignupTest < ActionController::IntegrationTest
test "signing up" do
# Given there are X users
2.times { Factory(:user) }
users_count = User.count
# When I go to the signup page
visit path_to('the signup page')
# And I fill in "Name" with "joebloggs"
fill_in "Name", :with => "joebloggs"
# And I fill in "Password" with "password"
fill_in "Password", :with => "password"
# And I fill in "Confirm password" with "password"
fill_in "Confirm password", :with => "password"
# And I press "Save"
click_button "Save"
# Then I should see "Dashboard"
assert_contain "Dashboard"
# And there should now be X+1 users
assert_equal (users_count + 1), User.count
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment