1 require "application_system_test_case"
3 class UserSignupTest < ApplicationSystemTestCase
4 include ActionMailer::TestHelper
7 stub_request(:get, /.*gravatar.com.*d=404/).to_return(:status => 404)
10 test "Sign up with confirmation email" do
15 within_content_body do
16 fill_in "Email", :with => "new_user_account@example.com"
17 fill_in "Display Name", :with => "new_user_account"
18 fill_in "Password", :with => "new_user_password"
19 fill_in "Confirm Password", :with => "new_user_password"
24 assert_content "We sent you a confirmation email"
28 email = ActionMailer::Base.deliveries.first
29 assert_equal 1, email.to.count
30 assert_equal "new_user_account@example.com", email.to.first
31 email_text = email.parts[0].parts[0].decoded
32 match = %r{/user/new_user_account/confirm\?confirm_string=\S+}.match(email_text)
37 assert_content "new_user_account"
38 assert_content "Welcome!"
41 test "Sign up from login page" do
46 within_content_body do
47 assert_content "Confirm Password"
51 test "Show OpenID form when OpenID provider button is clicked" do
54 within_content_body do
55 assert_no_field "OpenID URL"
56 assert_no_button "Continue"
58 click_on "Log in with OpenID"
60 assert_field "OpenID URL"
61 assert_button "Continue"