- password = "testtest2"
- assert_difference('User.count',0) do
- assert_difference('ActionMailer::Base.deliveries.size',0) do
- post "/user/terms",
- {:user => { :email => new_email, :email_confirmation => new_email, :display_name => display_name, :openid_url => "http://localhost:1123/john.doe?openid.failure=newuser", :pass_crypt => "", :pass_crypt_confirmation => ""}}
+ assert_difference("User.count", 0) do
+ assert_difference("ActionMailer::Base.deliveries.size", 0) do
+ post "/user/new",
+ :user => { :email => new_email, :email_confirmation => new_email, :display_name => display_name, :auth_provider => "openid", :auth_uid => "http://localhost:1123/new.tester", :pass_crypt => "", :pass_crypt_confirmation => "" }
+ assert_response :redirect
+ assert_redirected_to auth_path(:provider => "openid", :openid_url => "http://localhost:1123/new.tester", :origin => "/user/new")
+ follow_redirect!
+ assert_response :redirect
+ assert_redirected_to auth_success_path(:provider => "openid", :openid_url => "http://localhost:1123/new.tester", :origin => "/user/new")
+ follow_redirect!
+ assert_response :redirect
+ assert_redirected_to auth_failure_path(:strategy => "openid", :message => "connection_failed", :origin => "/user/new")
+ follow_redirect!