render :action => "new"
elsif current_user.auth_provider.present?
# Verify external authenticator before moving on
- session[:new_user] = current_user.slice("email", "display_name", "pass_crypt", "pass_crypt_confirmation")
+ session[:new_user] = current_user.slice("email", "display_name", "pass_crypt", "pass_crypt_confirmation", "consider_pd")
redirect_to auth_url(current_user.auth_provider, current_user.auth_uid), :status => :temporary_redirect
else
# Save the user record
- session[:new_user] = current_user.slice("email", "display_name", "pass_crypt", "pass_crypt_confirmation")
- redirect_to :action => :terms
+ session[:new_user] = current_user.slice("email", "display_name", "pass_crypt", "pass_crypt_confirmation", "consider_pd")
+ save_new_user
end
end
end
referer = safe_referer(params[:referer]) if params[:referer]
redirect_to referer || edit_account_path
- else
- new_user = session.delete(:new_user)
- verified_email = new_user.delete("verified_email")
-
- self.current_user = User.new(new_user)
-
- if check_signup_allowed(current_user.email)
- current_user.data_public = true
- current_user.description = "" if current_user.description.nil?
- current_user.creation_ip = request.remote_ip
- current_user.languages = http_accept_language.user_preferred_languages
- current_user.terms_agreed = Time.now.utc
- current_user.tou_agreed = Time.now.utc
- current_user.terms_seen = true
-
- if current_user.auth_uid.blank?
- current_user.auth_provider = nil
- current_user.auth_uid = nil
- elsif current_user.email == verified_email
- current_user.activate
- end
-
- if current_user.save
- SIGNUP_IP_LIMITER&.update(request.remote_ip)
- SIGNUP_EMAIL_LIMITER&.update(canonical_email(current_user.email))
-
- flash[:matomo_goal] = Settings.matomo["goals"]["signup"] if defined?(Settings.matomo)
-
- referer = welcome_path(welcome_options)
-
- if current_user.status == "active"
- session[:referer] = referer
- successful_login(current_user)
- else
- session[:pending_user] = current_user.id
- UserMailer.signup_confirm(current_user, current_user.generate_token_for(:new_user), referer).deliver_later
- redirect_to :controller => :confirmations, :action => :confirm, :display_name => current_user.display_name
- end
- else
- render :action => "new", :referer => params[:referer]
- end
- end
end
end
session[:new_user]["auth_uid"] = uid
session[:new_user]["verified_email"] = email if email_verified
- redirect_to :action => "terms"
+ save_new_user
else
user = User.find_by(:auth_provider => provider, :auth_uid => uid)
private
+ def save_new_user
+ new_user = session.delete(:new_user)
+ verified_email = new_user.delete("verified_email")
+
+ self.current_user = User.new(new_user)
+
+ if check_signup_allowed(current_user.email)
+ current_user.data_public = true
+ current_user.description = "" if current_user.description.nil?
+ current_user.creation_ip = request.remote_ip
+ current_user.languages = http_accept_language.user_preferred_languages
+ current_user.terms_agreed = Time.now.utc
+ current_user.tou_agreed = Time.now.utc
+ current_user.terms_seen = true
+
+ if current_user.auth_uid.blank?
+ current_user.auth_provider = nil
+ current_user.auth_uid = nil
+ elsif current_user.email == verified_email
+ current_user.activate
+ end
+
+ if current_user.save
+ SIGNUP_IP_LIMITER&.update(request.remote_ip)
+ SIGNUP_EMAIL_LIMITER&.update(canonical_email(current_user.email))
+
+ flash[:matomo_goal] = Settings.matomo["goals"]["signup"] if defined?(Settings.matomo)
+
+ referer = welcome_path(welcome_options)
+
+ if current_user.status == "active"
+ session[:referer] = referer
+ successful_login(current_user)
+ else
+ session[:pending_user] = current_user.id
+ UserMailer.signup_confirm(current_user, current_user.generate_token_for(:new_user), referer).deliver_later
+ redirect_to :controller => :confirmations, :action => :confirm, :display_name => current_user.display_name
+ end
+ else
+ render :action => "new", :referer => params[:referer]
+ end
+ end
+ end
+
def welcome_options
uri = URI(session[:referer]) if session[:referer].present?
def user_params
params.require(:user).permit(:email, :email_confirmation, :display_name,
:auth_provider, :auth_uid,
- :pass_crypt, :pass_crypt_confirmation)
+ :pass_crypt, :pass_crypt_confirmation,
+ :consider_pd)
end
##
def test_confirm_get
user = build(:user, :pending)
post user_new_path, :params => { :user => user.attributes }
- post user_save_path, :params => { :read_ct => 1, :read_tou => 1 }
confirm_string = User.find_by(:email => user.email).generate_token_for(:new_user)
get user_confirm_path, :params => { :display_name => user.display_name, :confirm_string => confirm_string }
user = build(:user, :pending)
stub_gravatar_request(user.email)
post user_new_path, :params => { :user => user.attributes }
- post user_save_path, :params => { :read_ct => 1, :read_tou => 1 }
confirm_string = User.find_by(:email => user.email).generate_token_for(:new_user)
# Get the confirmation page
user = build(:user, :pending)
stub_gravatar_request(user.email)
post user_new_path, :params => { :user => user.attributes }
- post user_save_path, :params => { :read_ct => 1, :read_tou => 1 }
confirm_string = User.find_by(:email => user.email).generate_token_for(:new_user)
post logout_path
user = build(:user, :pending)
stub_gravatar_request(user.email)
post user_new_path, :params => { :user => user.attributes }
- post user_save_path, :params => { :read_ct => 1, :read_tou => 1 }
confirm_string = User.find_by(:email => user.email).generate_token_for(:new_user)
post user_confirm_path, :params => { :display_name => user.display_name, :confirm_string => confirm_string }
user = build(:user, :pending)
stub_gravatar_request(user.email)
post user_new_path, :params => { :user => user.attributes }
- post user_save_path, :params => { :read_ct => 1, :read_tou => 1 }
confirm_string = User.find_by(:email => user.email).generate_token_for(:new_user)
post logout_path
user = build(:user, :pending)
stub_gravatar_request(user.email)
post user_new_path, :params => { :user => user.attributes }
- post user_save_path, :params => { :read_ct => 1, :read_tou => 1 }
confirm_string = User.find_by(:email => user.email).generate_token_for(:new_user)
post logout_path
user = build(:user, :pending)
stub_gravatar_request(user.email)
post user_new_path, :params => { :user => user.attributes }
- post user_save_path, :params => { :read_ct => 1, :read_tou => 1 }
confirm_string = User.find_by(:email => user.email).generate_token_for(:new_user)
post user_confirm_path, :params => { :display_name => user.display_name, :confirm_string => confirm_string, :referer => new_diary_entry_path }
user = build(:user, :pending)
stub_gravatar_request(user.email)
post user_new_path, :params => { :user => user.attributes }
- post user_save_path, :params => { :read_ct => 1, :read_tou => 1 }
confirm_string = User.find_by(:email => user.email).generate_token_for(:new_user)
post logout_path
user = build(:user, :pending)
stub_gravatar_request(user.email)
post user_new_path, :params => { :user => user.attributes }
- post user_save_path, :params => { :read_ct => 1, :read_tou => 1 }
confirm_string = User.find_by(:email => user.email).generate_token_for(:new_user)
travel 2.weeks do
user = build(:user, :pending)
stub_gravatar_request(user.email)
post user_new_path, :params => { :user => user.attributes }
- post user_save_path, :params => { :read_ct => 1, :read_tou => 1 }
confirm_string = User.find_by(:email => user.email).generate_token_for(:new_user)
post user_confirm_path, :params => { :display_name => user.display_name, :confirm_string => confirm_string, :referer => new_diary_entry_path }
user = build(:user, :pending)
stub_gravatar_request(user.email)
post user_new_path, :params => { :user => user.attributes }
- post user_save_path, :params => { :read_ct => 1, :read_tou => 1 }
confirm_string = User.find_by(:email => user.email).generate_token_for(:new_user)
User.find_by(:display_name => user.display_name).hide!
def test_confirm_resend_success
user = build(:user, :pending)
post user_new_path, :params => { :user => user.attributes }
- post user_save_path, :params => { :read_ct => 1, :read_tou => 1 }
assert_difference "ActionMailer::Base.deliveries.size", 1 do
perform_enqueued_jobs do
ActionMailer::Base.deliveries.clear
end
- def test_confirm_resend_no_token
- user = build(:user, :pending)
- # only complete first half of registration
- post user_new_path, :params => { :user => user.attributes }
-
- assert_no_difference "ActionMailer::Base.deliveries.size" do
- perform_enqueued_jobs do
- get user_confirm_resend_path(user)
- end
- end
-
- assert_redirected_to login_path
- assert_match "User #{user.display_name} not found.", flash[:error]
- end
-
def test_confirm_resend_deleted
user = build(:user, :pending)
post user_new_path, :params => { :user => user.attributes }
- post user_save_path, :params => { :read_ct => 1, :read_tou => 1 }
User.find_by(:display_name => user.display_name).hide!
def test_new_success
user = build(:user, :pending)
- assert_no_difference "User.count" do
- assert_no_difference "ActionMailer::Base.deliveries.size" do
- perform_enqueued_jobs do
- post user_new_path, :params => { :user => user.attributes }
- end
- end
- end
-
assert_difference "User.count", 1 do
assert_difference "ActionMailer::Base.deliveries.size", 1 do
perform_enqueued_jobs do
- post user_save_path, :params => { :read_ct => 1, :read_tou => 1 }
+ post user_new_path, :params => { :user => user.attributes }
end
end
end
assert_select "form > div > input.is-invalid#user_email"
end
- def test_save_duplicate_email
- user = build(:user, :pending)
-
- # Set up our user as being half-way through registration
- assert_no_difference "User.count" do
- assert_no_difference "ActionMailer::Base.deliveries.size" do
- perform_enqueued_jobs do
- post user_new_path, :params => { :user => user.attributes }
- end
- end
- end
-
- # Now create another user with that email
- create(:user, :email => user.email)
-
- # Check that the second half of registration fails
- assert_no_difference "User.count" do
- assert_no_difference "ActionMailer::Base.deliveries.size" do
- perform_enqueued_jobs do
- post user_save_path, :params => { :read_ct => 1, :read_tou => 1 }
- end
- end
- end
-
- assert_response :success
- assert_template "new"
- assert_select "form > div > input.is-invalid#user_email"
- end
-
- def test_save_duplicate_email_uppercase
+ def test_new_duplicate_email_uppercase
user = build(:user, :pending)
-
- # Set up our user as being half-way through registration
- assert_no_difference "User.count" do
- assert_no_difference "ActionMailer::Base.deliveries.size" do
- perform_enqueued_jobs do
- post user_new_path, :params => { :user => user.attributes }
- end
- end
- end
-
- # Now create another user with that email, but uppercased
create(:user, :email => user.email.upcase)
- # Check that the second half of registration fails
assert_no_difference "User.count" do
assert_no_difference "ActionMailer::Base.deliveries.size" do
perform_enqueued_jobs do
- post user_save_path, :params => { :read_ct => 1, :read_tou => 1 }
+ post user_new_path, :params => { :user => user.attributes }
end
end
end
assert_select "form > div > input.is-invalid#user_email"
end
- def test_save_duplicate_name
+ def test_new_duplicate_name
user = build(:user, :pending)
-
- # Set up our user as being half-way through registration
- assert_no_difference "User.count" do
- assert_no_difference "ActionMailer::Base.deliveries.size" do
- perform_enqueued_jobs do
- post user_new_path, :params => { :user => user.attributes }
- end
- end
- end
-
- # Now create another user with that display name
create(:user, :display_name => user.display_name)
- # Check that the second half of registration fails
assert_no_difference "User.count" do
assert_no_difference "ActionMailer::Base.deliveries.size" do
perform_enqueued_jobs do
- post user_save_path, :params => { :read_ct => 1, :read_tou => 1 }
+ post user_new_path, :params => { :user => user.attributes }
end
end
end
assert_select "form > div > input.is-invalid#user_display_name"
end
- def test_save_duplicate_name_uppercase
+ def test_new_duplicate_name_uppercase
user = build(:user, :pending)
-
- # Set up our user as being half-way through registration
- assert_no_difference "User.count" do
- assert_no_difference "ActionMailer::Base.deliveries.size" do
- perform_enqueued_jobs do
- post user_new_path, :params => { :user => user.attributes }
- end
- end
- end
-
- # Now create another user with that display_name, but uppercased
create(:user, :display_name => user.display_name.upcase)
- # Check that the second half of registration fails
assert_no_difference "User.count" do
assert_no_difference "ActionMailer::Base.deliveries.size" do
perform_enqueued_jobs do
- post user_save_path, :params => { :read_ct => 1, :read_tou => 1 }
+ post user_new_path, :params => { :user => user.attributes }
end
end
end
assert_select "form > div > input.is-invalid#user_display_name"
end
- def test_save_blocked_domain
+ def test_new_blocked_domain
user = build(:user, :pending, :email => "user@example.net")
- # Set up our user as being half-way through registration
- assert_no_difference "User.count" do
- assert_no_difference "ActionMailer::Base.deliveries.size" do
- perform_enqueued_jobs do
- post user_new_path, :params => { :user => user.attributes }
- end
- end
- end
-
# Now block that domain
create(:acl, :domain => "example.net", :k => "no_account_creation")
assert_no_difference "User.count" do
assert_no_difference "ActionMailer::Base.deliveries.size" do
perform_enqueued_jobs do
- post user_save_path, :params => { :read_ct => 1, :read_tou => 1 }
+ post user_new_path, :params => { :user => user.attributes }
end
end
end
def test_save_referer_params
user = build(:user, :pending)
- # Set up our user as being half-way through registration
- assert_no_difference "User.count" do
- assert_no_difference "ActionMailer::Base.deliveries.size" do
- perform_enqueued_jobs do
- post user_new_path, :params => { :user => user.attributes, :referer => "/edit?editor=id#map=1/2/3" }
- end
- end
- end
-
assert_difference "User.count", 1 do
assert_difference "ActionMailer::Base.deliveries.size", 1 do
- post user_save_path, :params => { :read_ct => 1, :read_tou => 1 }
+ post user_new_path, :params => { :user => user.attributes, :referer => "/edit?editor=id#map=1/2/3" }
assert_enqueued_with :job => ActionMailer::MailDeliveryJob,
:args => proc { |args| args[3][:args][2] == welcome_path(:editor => "id", :zoom => 1, :lat => 2, :lon => 3) }
perform_enqueued_jobs
ActionMailer::Base.deliveries.clear
end
- def test_terms_new_user
- user = build(:user, :pending)
-
- # Set up our user as being half-way through registration
- assert_no_difference "User.count" do
- assert_no_difference "ActionMailer::Base.deliveries.size" do
- perform_enqueued_jobs do
- post user_new_path, :params => { :user => user.attributes }
- end
- end
- end
-
- get user_terms_path
-
- assert_response :success
- assert_template :terms
- end
-
def test_terms_agreed
user = create(:user, :terms_seen => true, :terms_agreed => Date.yesterday)
:email_confirmation => dup_email,
:display_name => display_name,
:pass_crypt => "testtest",
- :pass_crypt_confirmation => "testtest" } }
+ :pass_crypt_confirmation => "testtest",
+ :consider_pd => "1" } }
end
end
end
new_email = "newtester@osm.org"
display_name = "new_tester"
- assert_difference("User.count", 0) do
- assert_difference("ActionMailer::Base.deliveries.size", 0) do
+ assert_difference("User.count", 1) do
+ assert_difference("ActionMailer::Base.deliveries.size", 1) do
perform_enqueued_jobs do
post "/user/new",
:params => { :user => { :email => new_email,
:email_confirmation => new_email,
:display_name => display_name,
:pass_crypt => "testtest",
- :pass_crypt_confirmation => "testtest" } }
- end
- end
- end
-
- assert_redirected_to "/user/terms"
-
- assert_difference("User.count") do
- assert_difference("ActionMailer::Base.deliveries.size", 1) do
- perform_enqueued_jobs do
- post "/user/save",
- :params => { :read_ct => 1, :read_tou => 1 }
+ :pass_crypt_confirmation => "testtest",
+ :consider_pd => "1" } }
+ assert_response :redirect
+ assert_redirected_to :controller => :confirmations, :action => :confirm, :display_name => display_name
follow_redirect!
end
end
assert_equal user, User.authenticate(:username => new_email, :password => "testtest")
end
- def test_user_create_no_tou_failure
- new_email = "#newtester@osm.org"
- display_name = "new_tester"
-
- assert_difference("User.count", 0) do
- assert_difference("ActionMailer::Base.deliveries.size", 0) do
- perform_enqueued_jobs do
- post "/user/new",
- :params => { :user => { :email => new_email,
- :email_confirmation => new_email,
- :display_name => display_name,
- :pass_crypt => "testtest",
- :pass_crypt_confirmation => "testtest" } }
- end
- end
- end
-
- assert_redirected_to "/user/terms"
-
- perform_enqueued_jobs do
- post "/user/save"
- assert_redirected_to "/user/terms"
- end
-
- ActionMailer::Base.deliveries.clear
- end
-
# Check that the user can successfully recover their password
def test_lost_password_recovery_success
# Open the lost password form
:email_confirmation => new_email,
:display_name => display_name,
:pass_crypt => password,
- :pass_crypt_confirmation => password },
+ :pass_crypt_confirmation => password,
+ :consider_pd => "1" },
:referer => referer }
- assert_redirected_to "/user/terms"
- post "/user/save",
- :params => { :user => { :email => new_email,
- :email_confirmation => new_email,
- :display_name => display_name,
- :pass_crypt => password,
- :pass_crypt_confirmation => password },
- :read_ct => 1, :read_tou => 1 }
+ assert_response(:redirect)
+ assert_redirected_to :controller => :confirmations, :action => :confirm, :display_name => display_name
follow_redirect!
end
end
:display_name => display_name,
:auth_provider => "openid",
:auth_uid => "http://localhost:1123/new.tester",
- :pass_crypt => "",
- :pass_crypt_confirmation => "" } }
+ :pass_crypt => password,
+ :pass_crypt_confirmation => password,
+ :consider_pd => "1" } }
assert_redirected_to auth_path(:provider => "openid", :openid_url => "http://localhost:1123/new.tester", :origin => "/user/new")
post response.location
assert_redirected_to auth_success_path(:provider => "openid", :openid_url => "http://localhost:1123/new.tester", :origin => "/user/new")
follow_redirect!
- assert_redirected_to "/user/terms"
- post "/user/save",
- :params => { :user => { :email => new_email,
- :email_confirmation => new_email,
- :display_name => display_name,
- :auth_provider => "openid",
- :auth_uid => "http://localhost:1123/new.tester",
- :pass_crypt => password,
- :pass_crypt_confirmation => password },
- :read_ct => 1, :read_tou => 1 }
- assert_response :redirect
+ assert_redirected_to :controller => :confirmations, :action => :confirm, :display_name => display_name
follow_redirect!
end
end
:display_name => display_name,
:auth_provider => "openid",
:auth_uid => "http://localhost:1123/new.tester",
- :pass_crypt => "",
- :pass_crypt_confirmation => "" } }
+ :pass_crypt => "testtest",
+ :pass_crypt_confirmation => "testtest",
+ :consider_pd => "1" } }
assert_redirected_to auth_path(:provider => "openid", :openid_url => "http://localhost:1123/new.tester", :origin => "/user/new")
post response.location
assert_redirected_to auth_success_path(:provider => "openid", :openid_url => "http://localhost:1123/new.tester", :origin => "/user/new")
:display_name => display_name,
:auth_provider => "openid",
:auth_uid => "http://localhost:1123/new.tester",
- :pass_crypt => "",
- :pass_crypt_confirmation => "" },
+ :pass_crypt => "testtest",
+ :pass_crypt_confirmation => "testtest",
+ :consider_pd => "1" },
:referer => referer }
assert_redirected_to auth_path(:provider => "openid", :openid_url => "http://localhost:1123/new.tester", :origin => "/user/new")
post response.location
assert_redirected_to auth_success_path(:provider => "openid", :openid_url => "http://localhost:1123/new.tester", :origin => "/user/new")
follow_redirect!
- assert_redirected_to "/user/terms"
- post "/user/save",
- :params => { :user => { :email => new_email,
- :email_confirmation => new_email,
- :display_name => display_name,
- :auth_provider => "openid",
- :auth_uid => "http://localhost:1123/new.tester",
- :pass_crypt => "testtest",
- :pass_crypt_confirmation => "testtest" },
- :read_ct => 1, :read_tou => 1 }
+ assert_redirected_to :controller => :confirmations, :action => :confirm, :display_name => display_name
follow_redirect!
end
end
:email_confirmation => new_email,
:display_name => display_name,
:auth_provider => "google",
- :pass_crypt => "",
- :pass_crypt_confirmation => "" } }
+ :pass_crypt => password,
+ :pass_crypt_confirmation => password,
+ :consider_pd => "1" } }
assert_redirected_to auth_path(:provider => "google", :origin => "/user/new")
post response.location
assert_redirected_to auth_success_path(:provider => "google")
follow_redirect!
- assert_redirected_to "/user/terms"
- post "/user/save",
- :params => { :user => { :email => new_email,
- :email_confirmation => new_email,
- :display_name => display_name,
- :auth_provider => "google",
- :auth_uid => "123454321",
- :pass_crypt => password,
- :pass_crypt_confirmation => password },
- :read_ct => 1, :read_tou => 1 }
assert_redirected_to welcome_path
follow_redirect!
end
:display_name => display_name,
:auth_provider => "google",
:pass_crypt => "",
- :pass_crypt_confirmation => "" } }
+ :pass_crypt_confirmation => "",
+ :consider_pd => "1" } }
assert_redirected_to auth_path(:provider => "google", :origin => "/user/new")
post response.location
assert_redirected_to auth_success_path(:provider => "google")
:email_confirmation => new_email,
:display_name => display_name,
:auth_provider => "google",
- :pass_crypt => "",
- :pass_crypt_confirmation => "" },
+ :pass_crypt => "testtest",
+ :pass_crypt_confirmation => "testtest",
+ :consider_pd => "1" },
:referer => referer }
assert_redirected_to auth_path(:provider => "google", :origin => "/user/new")
post response.location
assert_redirected_to auth_success_path(:provider => "google")
follow_redirect!
- assert_redirected_to "/user/terms"
- post "/user/save",
- :params => { :user => { :email => new_email,
- :email_confirmation => new_email,
- :display_name => display_name,
- :auth_provider => "google",
- :auth_uid => "http://localhost:1123/new.tester",
- :pass_crypt => "testtest",
- :pass_crypt_confirmation => "testtest" },
- :read_ct => 1, :read_tou => 1 }
+ assert_redirected_to :controller => :confirmations, :action => :confirm, :display_name => display_name
follow_redirect!
end
end
:email_confirmation => new_email,
:display_name => display_name,
:auth_provider => "facebook",
- :pass_crypt => "",
- :pass_crypt_confirmation => "" } }
+ :pass_crypt => password,
+ :pass_crypt_confirmation => password,
+ :consider_pd => "1" } }
assert_redirected_to auth_path(:provider => "facebook", :origin => "/user/new")
post response.location
assert_redirected_to auth_success_path(:provider => "facebook")
follow_redirect!
- assert_redirected_to "/user/terms"
- post "/user/save",
- :params => { :user => { :email => new_email,
- :email_confirmation => new_email,
- :display_name => display_name,
- :auth_provider => "facebook",
- :auth_uid => "123454321",
- :pass_crypt => password,
- :pass_crypt_confirmation => password },
- :read_ct => 1, :read_tou => 1 }
assert_redirected_to welcome_path
follow_redirect!
end
:display_name => display_name,
:auth_provider => "facebook",
:pass_crypt => "",
- :pass_crypt_confirmation => "" } }
+ :pass_crypt_confirmation => "",
+ :consider_pd => "1" } }
assert_redirected_to auth_path(:provider => "facebook", :origin => "/user/new")
post response.location
assert_redirected_to auth_success_path(:provider => "facebook")
:email_confirmation => new_email,
:display_name => display_name,
:auth_provider => "facebook",
- :pass_crypt => "",
- :pass_crypt_confirmation => "" },
+ :pass_crypt => "testtest",
+ :pass_crypt_confirmation => "testtest",
+ :consider_pd => "1" },
:referer => referer }
assert_redirected_to auth_path(:provider => "facebook", :origin => "/user/new")
post response.location
assert_redirected_to auth_success_path(:provider => "facebook")
follow_redirect!
- assert_redirected_to "/user/terms"
- post "/user/save",
- :params => { :user => { :email => new_email,
- :email_confirmation => new_email,
- :display_name => display_name,
- :auth_provider => "facebook",
- :auth_uid => "http://localhost:1123/new.tester",
- :pass_crypt => "testtest",
- :pass_crypt_confirmation => "testtest" },
- :read_ct => 1, :read_tou => 1 }
+ assert_redirected_to :controller => :confirmations, :action => :confirm, :display_name => display_name
follow_redirect!
end
end
:email_confirmation => new_email,
:display_name => display_name,
:auth_provider => "microsoft",
- :pass_crypt => "",
- :pass_crypt_confirmation => "" } }
+ :pass_crypt => password,
+ :pass_crypt_confirmation => password,
+ :consider_pd => "1" } }
assert_redirected_to auth_path(:provider => "microsoft", :origin => "/user/new")
post response.location
assert_redirected_to auth_success_path(:provider => "microsoft")
follow_redirect!
- assert_redirected_to "/user/terms"
- post "/user/save",
- :params => { :user => { :email => new_email,
- :email_confirmation => new_email,
- :display_name => display_name,
- :auth_provider => "microsoft",
- :auth_uid => "123454321",
- :pass_crypt => password,
- :pass_crypt_confirmation => password },
- :read_ct => 1, :read_tou => 1 }
assert_redirected_to welcome_path
follow_redirect!
end
:display_name => display_name,
:auth_provider => "microsoft",
:pass_crypt => "",
- :pass_crypt_confirmation => "" } }
+ :pass_crypt_confirmation => "",
+ :consider_pd => "1" } }
assert_redirected_to auth_path(:provider => "microsoft", :origin => "/user/new")
post response.location
assert_redirected_to auth_success_path(:provider => "microsoft")
:email_confirmation => new_email,
:display_name => display_name,
:auth_provider => "microsoft",
- :pass_crypt => "",
- :pass_crypt_confirmation => "" },
+ :pass_crypt => "testtest",
+ :pass_crypt_confirmation => "testtest",
+ :consider_pd => "1" },
:referer => referer }
assert_redirected_to auth_path(:provider => "microsoft", :origin => "/user/new")
post response.location
assert_redirected_to auth_success_path(:provider => "microsoft")
follow_redirect!
- assert_redirected_to "/user/terms"
- post "/user/save",
- :params => { :user => { :email => new_email,
- :email_confirmation => new_email,
- :display_name => display_name,
- :auth_provider => "microsoft",
- :auth_uid => "http://localhost:1123/new.tester",
- :pass_crypt => "testtest",
- :pass_crypt_confirmation => "testtest" },
- :read_ct => 1, :read_tou => 1 }
+ assert_redirected_to :controller => :confirmations, :action => :confirm, :display_name => display_name
follow_redirect!
end
end
:email_confirmation => new_email,
:display_name => display_name,
:auth_provider => "github",
- :pass_crypt => "",
- :pass_crypt_confirmation => "" } }
+ :pass_crypt => password,
+ :pass_crypt_confirmation => password,
+ :consider_pd => "1" } }
assert_redirected_to auth_path(:provider => "github", :origin => "/user/new")
post response.location
assert_redirected_to auth_success_path(:provider => "github")
follow_redirect!
- assert_redirected_to "/user/terms"
- post "/user/save",
- :params => { :user => { :email => new_email,
- :email_confirmation => new_email,
- :display_name => display_name,
- :auth_provider => "github",
- :auth_uid => "123454321",
- :pass_crypt => password,
- :pass_crypt_confirmation => password },
- :read_ct => 1,
- :read_tou => 1 }
assert_redirected_to welcome_path
follow_redirect!
end
:display_name => display_name,
:auth_provider => "github",
:pass_crypt => "",
- :pass_crypt_confirmation => "" } }
+ :pass_crypt_confirmation => "",
+ :consider_pd => "1" } }
assert_redirected_to auth_path(:provider => "github", :origin => "/user/new")
post response.location
assert_redirected_to auth_success_path(:provider => "github")
:email_confirmation => new_email,
:display_name => display_name,
:auth_provider => "github",
- :pass_crypt => "",
- :pass_crypt_confirmation => "" },
+ :pass_crypt => "testtest",
+ :pass_crypt_confirmation => "testtest",
+ :consider_pd => "1" },
:referer => referer }
assert_redirected_to auth_path(:provider => "github", :origin => "/user/new")
post response.location
assert_redirected_to auth_success_path(:provider => "github")
follow_redirect!
- assert_redirected_to "/user/terms"
- post "/user/save",
- :params => { :user => { :email => new_email,
- :email_confirmation => new_email,
- :display_name => display_name,
- :auth_provider => "github",
- :auth_uid => "http://localhost:1123/new.tester",
- :pass_crypt => "testtest",
- :pass_crypt_confirmation => "testtest" },
- :read_ct => 1,
- :read_tou => 1 }
+ assert_redirected_to :controller => :confirmations, :action => :confirm, :display_name => display_name
follow_redirect!
end
end
:email_confirmation => new_email,
:display_name => display_name,
:auth_provider => "wikipedia",
- :pass_crypt => "",
- :pass_crypt_confirmation => "" } }
+ :pass_crypt => password,
+ :pass_crypt_confirmation => password,
+ :consider_pd => "1" } }
assert_redirected_to auth_path(:provider => "wikipedia", :origin => "/user/new")
post response.location
assert_redirected_to auth_success_path(:provider => "wikipedia", :origin => "/user/new")
follow_redirect!
- assert_redirected_to "/user/terms"
- post "/user/save",
- :params => { :user => { :email => new_email,
- :email_confirmation => new_email,
- :display_name => display_name,
- :auth_provider => "wikipedia",
- :auth_uid => "123454321",
- :pass_crypt => password,
- :pass_crypt_confirmation => password },
- :read_ct => 1,
- :read_tou => 1 }
assert_redirected_to welcome_path
follow_redirect!
end
:display_name => display_name,
:auth_provider => "wikipedia",
:pass_crypt => "",
- :pass_crypt_confirmation => "" } }
+ :pass_crypt_confirmation => "",
+ :consider_pd => "1" } }
assert_redirected_to auth_path(:provider => "wikipedia", :origin => "/user/new")
post response.location
assert_redirected_to auth_success_path(:provider => "wikipedia", :origin => "/user/new")
:email_confirmation => new_email,
:display_name => display_name,
:auth_provider => "wikipedia",
- :pass_crypt => "",
- :pass_crypt_confirmation => "" },
+ :pass_crypt => "testtest",
+ :pass_crypt_confirmation => "testtest",
+ :consider_pd => "1" },
:referer => referer }
assert_redirected_to auth_path(:provider => "wikipedia", :origin => "/user/new")
post response.location
assert_redirected_to auth_success_path(:provider => "wikipedia", :origin => "/user/new")
follow_redirect!
- assert_redirected_to "/user/terms"
- post "/user/save",
- :params => { :user => { :email => new_email,
- :email_confirmation => new_email,
- :display_name => display_name,
- :auth_provider => "wikipedia",
- :auth_uid => "http://localhost:1123/new.tester",
- :pass_crypt => "testtest",
- :pass_crypt_confirmation => "testtest" },
- :read_ct => 1,
- :read_tou => 1 }
+ assert_redirected_to :controller => :confirmations, :action => :confirm, :display_name => display_name
follow_redirect!
end
end