assert_difference("User.count", 0) do
assert_difference("ActionMailer::Base.deliveries.size", 0) do
perform_enqueued_jobs do
assert_difference("User.count", 0) do
assert_difference("ActionMailer::Base.deliveries.size", 0) do
perform_enqueued_jobs do
:params => { :user => { :email => dup_email,
:display_name => display_name,
:pass_crypt => "testtest",
:params => { :user => { :email => dup_email,
:display_name => display_name,
:pass_crypt => "testtest",
assert_difference("User.count", 0) do
assert_no_difference("ActionMailer::Base.deliveries.size") do
perform_enqueued_jobs do
assert_difference("User.count", 0) do
assert_no_difference("ActionMailer::Base.deliveries.size") do
perform_enqueued_jobs do
:params => { :user => { :email => dup_email,
:display_name => display_name,
:pass_crypt => "testtest",
:pass_crypt_confirmation => "testtest",
:params => { :user => { :email => dup_email,
:display_name => display_name,
:pass_crypt => "testtest",
:pass_crypt_confirmation => "testtest",
assert_difference("User.count", 0) do
assert_difference("ActionMailer::Base.deliveries.size", 0) do
perform_enqueued_jobs do
assert_difference("User.count", 0) do
assert_difference("ActionMailer::Base.deliveries.size", 0) do
perform_enqueued_jobs do
:params => { :user => { :email => email,
:display_name => dup_display_name,
:pass_crypt => "testtest",
:params => { :user => { :email => email,
:display_name => dup_display_name,
:pass_crypt => "testtest",
assert_difference("User.count", 0) do
assert_difference("ActionMailer::Base.deliveries.size", 0) do
perform_enqueued_jobs do
assert_difference("User.count", 0) do
assert_difference("ActionMailer::Base.deliveries.size", 0) do
perform_enqueued_jobs do
:params => { :user => { :email => email,
:display_name => display_name,
:pass_crypt => "testtest",
:params => { :user => { :email => email,
:display_name => display_name,
:pass_crypt => "testtest",
assert_difference("User.count", 0) do
assert_no_difference("ActionMailer::Base.deliveries.size") do
perform_enqueued_jobs do
assert_difference("User.count", 0) do
assert_no_difference("ActionMailer::Base.deliveries.size") do
perform_enqueued_jobs do
:params => { :user => { :email => email,
:display_name => dup_display_name,
:params => { :user => { :email => email,
:display_name => dup_display_name,
assert_difference("User.count", 1) do
assert_difference("ActionMailer::Base.deliveries.size", 1) do
perform_enqueued_jobs do
assert_difference("User.count", 1) do
assert_difference("ActionMailer::Base.deliveries.size", 1) do
perform_enqueued_jobs do
:params => { :user => { :email => new_email,
:display_name => display_name,
:pass_crypt => "testtest",
:params => { :user => { :email => new_email,
:display_name => display_name,
:pass_crypt => "testtest",
- def test_lost_password_recovery_success
- # Open the lost password form
- # Submit the lost password form
- # Check the e-mail
- # Submit the reset password token
- # Check that the password has changed, and the user can login
- end
+ # def test_lost_password_recovery_success
+ # Open the lost password form
+ # Submit the lost password form
+ # Check the e-mail
+ # Submit the reset password token
+ # Check that the password has changed, and the user can login
+ # end
assert_difference("User.count") do
assert_difference("ActionMailer::Base.deliveries.size", 1) do
perform_enqueued_jobs do
assert_difference("User.count") do
assert_difference("ActionMailer::Base.deliveries.size", 1) do
perform_enqueued_jobs do
:params => { :user => { :email => new_email,
:display_name => display_name,
:pass_crypt => password,
:params => { :user => { :email => new_email,
:display_name => display_name,
:pass_crypt => password,
def test_user_create_openid_success
new_email = "newtester-openid@osm.org"
display_name = "new_tester-openid"
def test_user_create_openid_success
new_email = "newtester-openid@osm.org"
display_name = "new_tester-openid"
auth_uid = "http://localhost:1123/new.tester"
OmniAuth.config.add_mock(:openid,
auth_uid = "http://localhost:1123/new.tester"
OmniAuth.config.add_mock(:openid,
assert_difference("User.count") do
assert_difference("ActionMailer::Base.deliveries.size", 1) do
perform_enqueued_jobs do
assert_difference("User.count") do
assert_difference("ActionMailer::Base.deliveries.size", 1) do
perform_enqueued_jobs do
- post auth_path(:provider => "openid", :openid_url => "http://localhost:1123/new.tester", :origin => "/user/new")
- assert_redirected_to auth_success_path(:provider => "openid", :openid_url => "http://localhost:1123/new.tester", :origin => "/user/new")
+ post auth_path(:provider => "openid", :openid_url => openid_url, :origin => "/user/new")
+ assert_redirected_to auth_success_path(:provider => "openid", :openid_url => openid_url, :origin => "/user/new")
follow_redirect!
assert_redirected_to :controller => :users, :action => "new", :nickname => display_name, :email => new_email,
:auth_provider => "openid", :auth_uid => auth_uid
follow_redirect!
follow_redirect!
assert_redirected_to :controller => :users, :action => "new", :nickname => display_name, :email => new_email,
:auth_provider => "openid", :auth_uid => auth_uid
follow_redirect!
:params => { :user => { :email => new_email,
:display_name => display_name,
:auth_provider => "openid",
:params => { :user => { :email => new_email,
:display_name => display_name,
:auth_provider => "openid",
assert_difference("User.count") do
assert_difference("ActionMailer::Base.deliveries.size", 1) do
perform_enqueued_jobs do
assert_difference("User.count") do
assert_difference("ActionMailer::Base.deliveries.size", 1) do
perform_enqueued_jobs do
- post auth_path(:provider => "openid", :openid_url => "http://localhost:1123/new.tester", :origin => "/user/new")
- assert_redirected_to auth_success_path(:provider => "openid", :openid_url => "http://localhost:1123/new.tester", :origin => "/user/new")
+ post auth_path(:provider => "openid", :openid_url => openid_url, :origin => "/user/new")
+ assert_redirected_to auth_success_path(:provider => "openid", :openid_url => openid_url, :origin => "/user/new")
follow_redirect!
assert_redirected_to :controller => :users, :action => "new", :nickname => display_name, :email => new_email,
:auth_provider => "openid", :auth_uid => auth_uid
follow_redirect!
follow_redirect!
assert_redirected_to :controller => :users, :action => "new", :nickname => display_name, :email => new_email,
:auth_provider => "openid", :auth_uid => auth_uid
follow_redirect!
:params => { :user => { :email => new_email,
:display_name => display_name,
:auth_provider => "openid",
:params => { :user => { :email => new_email,
:display_name => display_name,
:auth_provider => "openid",
assert_redirected_to auth_success_path(:provider => "google")
follow_redirect!
assert_redirected_to :controller => :users, :action => "new", :nickname => display_name,
assert_redirected_to auth_success_path(:provider => "google")
follow_redirect!
assert_redirected_to :controller => :users, :action => "new", :nickname => display_name,
:params => { :user => { :email => new_email,
:display_name => display_name,
:auth_provider => "google",
:auth_uid => auth_uid,
:consider_pd => "1" },
:params => { :user => { :email => new_email,
:display_name => display_name,
:auth_provider => "google",
:auth_uid => auth_uid,
:consider_pd => "1" },
assert_redirected_to auth_success_path(:provider => "google")
follow_redirect!
assert_redirected_to :controller => :users, :action => "new", :nickname => display_name, :email => dup_user.email,
assert_redirected_to auth_success_path(:provider => "google")
follow_redirect!
assert_redirected_to :controller => :users, :action => "new", :nickname => display_name, :email => dup_user.email,
assert_redirected_to auth_success_path(:provider => "google")
follow_redirect!
assert_redirected_to :controller => :users, :action => "new", :nickname => display_name,
assert_redirected_to auth_success_path(:provider => "google")
follow_redirect!
assert_redirected_to :controller => :users, :action => "new", :nickname => display_name,
:display_name => display_name,
:auth_provider => "google",
:auth_uid => auth_uid,
:display_name => display_name,
:auth_provider => "google",
:auth_uid => auth_uid,
assert_redirected_to auth_success_path(:provider => "facebook")
follow_redirect!
assert_redirected_to :controller => :users, :action => "new", :nickname => display_name,
assert_redirected_to auth_success_path(:provider => "facebook")
follow_redirect!
assert_redirected_to :controller => :users, :action => "new", :nickname => display_name,
:params => { :user => { :email => new_email,
:display_name => display_name,
:auth_provider => "facebook",
:auth_uid => auth_uid,
:consider_pd => "1" },
:params => { :user => { :email => new_email,
:display_name => display_name,
:auth_provider => "facebook",
:auth_uid => auth_uid,
:consider_pd => "1" },
assert_redirected_to auth_success_path(:provider => "facebook")
follow_redirect!
assert_redirected_to :controller => :users, :action => "new", :nickname => display_name, :email => dup_user.email,
assert_redirected_to auth_success_path(:provider => "facebook")
follow_redirect!
assert_redirected_to :controller => :users, :action => "new", :nickname => display_name, :email => dup_user.email,
assert_redirected_to auth_success_path(:provider => "facebook")
follow_redirect!
assert_redirected_to :controller => :users, :action => "new", :nickname => display_name,
assert_redirected_to auth_success_path(:provider => "facebook")
follow_redirect!
assert_redirected_to :controller => :users, :action => "new", :nickname => display_name,
:display_name => display_name,
:auth_provider => "facebook",
:auth_uid => auth_uid,
:display_name => display_name,
:auth_provider => "facebook",
:auth_uid => auth_uid,
assert_redirected_to auth_success_path(:provider => "microsoft")
follow_redirect!
assert_redirected_to :controller => :users, :action => "new", :nickname => display_name,
assert_redirected_to auth_success_path(:provider => "microsoft")
follow_redirect!
assert_redirected_to :controller => :users, :action => "new", :nickname => display_name,
:params => { :user => { :email => new_email,
:display_name => display_name,
:auth_provider => "microsoft",
:auth_uid => auth_uid,
:consider_pd => "1" },
:params => { :user => { :email => new_email,
:display_name => display_name,
:auth_provider => "microsoft",
:auth_uid => auth_uid,
:consider_pd => "1" },
assert_redirected_to auth_success_path(:provider => "microsoft")
follow_redirect!
assert_redirected_to :controller => :users, :action => "new", :nickname => display_name, :email => dup_user.email,
assert_redirected_to auth_success_path(:provider => "microsoft")
follow_redirect!
assert_redirected_to :controller => :users, :action => "new", :nickname => display_name, :email => dup_user.email,
assert_redirected_to auth_success_path(:provider => "microsoft")
follow_redirect!
assert_redirected_to :controller => :users, :action => "new", :nickname => display_name,
assert_redirected_to auth_success_path(:provider => "microsoft")
follow_redirect!
assert_redirected_to :controller => :users, :action => "new", :nickname => display_name,
:display_name => display_name,
:auth_provider => "microsoft",
:auth_uid => auth_uid,
:display_name => display_name,
:auth_provider => "microsoft",
:auth_uid => auth_uid,
assert_redirected_to auth_success_path(:provider => "github")
follow_redirect!
assert_redirected_to :controller => :users, :action => "new", :nickname => display_name,
assert_redirected_to auth_success_path(:provider => "github")
follow_redirect!
assert_redirected_to :controller => :users, :action => "new", :nickname => display_name,
:params => { :user => { :email => new_email,
:display_name => display_name,
:auth_provider => "github",
:params => { :user => { :email => new_email,
:display_name => display_name,
:auth_provider => "github",
assert_redirected_to auth_success_path(:provider => "github")
follow_redirect!
assert_redirected_to :controller => :users, :action => "new", :nickname => display_name,
assert_redirected_to auth_success_path(:provider => "github")
follow_redirect!
assert_redirected_to :controller => :users, :action => "new", :nickname => display_name,
assert_redirected_to auth_success_path(:provider => "github")
follow_redirect!
assert_redirected_to :controller => :users, :action => "new", :nickname => display_name,
assert_redirected_to auth_success_path(:provider => "github")
follow_redirect!
assert_redirected_to :controller => :users, :action => "new", :nickname => display_name,
:display_name => display_name,
:auth_provider => "github",
:auth_uid => auth_uid,
:display_name => display_name,
:auth_provider => "github",
:auth_uid => auth_uid,
assert_redirected_to auth_success_path(:provider => "wikipedia", :origin => "/user/new")
follow_redirect!
assert_redirected_to :controller => :users, :action => "new", :nickname => display_name,
assert_redirected_to auth_success_path(:provider => "wikipedia", :origin => "/user/new")
follow_redirect!
assert_redirected_to :controller => :users, :action => "new", :nickname => display_name,
:params => { :user => { :email => new_email,
:display_name => display_name,
:auth_provider => "wikipedia",
:params => { :user => { :email => new_email,
:display_name => display_name,
:auth_provider => "wikipedia",
assert_redirected_to auth_success_path(:provider => "wikipedia", :origin => "/user/new")
follow_redirect!
assert_redirected_to :controller => :users, :action => "new", :nickname => display_name,
assert_redirected_to auth_success_path(:provider => "wikipedia", :origin => "/user/new")
follow_redirect!
assert_redirected_to :controller => :users, :action => "new", :nickname => display_name,
assert_redirected_to auth_success_path(:provider => "wikipedia", :origin => "/user/new")
follow_redirect!
assert_redirected_to :controller => :users, :action => "new", :nickname => display_name,
assert_redirected_to auth_success_path(:provider => "wikipedia", :origin => "/user/new")
follow_redirect!
assert_redirected_to :controller => :users, :action => "new", :nickname => display_name,
:display_name => display_name,
:auth_provider => "wikipedia",
:auth_uid => auth_uid,
:display_name => display_name,
:auth_provider => "wikipedia",
:auth_uid => auth_uid,