:display_name => display_name,
:pass_crypt => "testtest",
:pass_crypt_confirmation => "testtest",
- :auth_provider => "auth_provider",
+ :auth_provider => "google",
:auth_uid => "123454321",
:consider_pd => "1" } }
end
post "/user/new",
:params => { :user => { :email => email,
:display_name => dup_display_name,
- :auth_provider => "provider",
+ :auth_provider => "google",
:auth_uid => "123454321",
:consider_pd => "1" } }
end
def test_user_create_openid_success
new_email = "newtester-openid@osm.org"
display_name = "new_tester-openid"
+ openid_url = "http://localhost:1000/new.tester"
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
- 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
:params => { :user => { :email => new_email,
:display_name => display_name,
:auth_provider => "openid",
- :auth_uid => "http://localhost:1123/new.tester",
+ :auth_uid => auth_uid,
:consider_pd => "1" } }
end
end
end
def test_user_create_openid_redirect
- auth_uid = "12345654321"
+ openid_url = "http://localhost:1000/new.tester"
+ auth_uid = "http://localhost:1123/new.tester"
new_email = "redirect_tester_openid@osm.org"
display_name = "redirect_tester_openid"
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
def test_user_create_google_success
new_email = "newtester-google@osm.org"
- verified_email = UsersController.message_hmac(new_email)
+ email_hmac = UsersController.message_hmac(new_email)
display_name = "new_tester-google"
auth_uid = "123454321"
assert_redirected_to auth_success_path(:provider => "google")
follow_redirect!
assert_redirected_to :controller => :users, :action => "new", :nickname => display_name,
- :email => new_email, :verified_email => verified_email,
+ :email => new_email, :email_hmac => email_hmac,
:auth_provider => "google", :auth_uid => auth_uid
follow_redirect!
:auth_provider => "google",
:auth_uid => auth_uid,
:consider_pd => "1" },
- :verified_email => verified_email }
+ :email_hmac => email_hmac }
assert_redirected_to welcome_path
follow_redirect!
end
assert_redirected_to auth_success_path(:provider => "google")
follow_redirect!
assert_redirected_to :controller => :users, :action => "new", :nickname => display_name, :email => dup_user.email,
- :verified_email => UsersController.message_hmac(dup_user.email),
+ :email_hmac => UsersController.message_hmac(dup_user.email),
:auth_provider => "google", :auth_uid => auth_uid
follow_redirect!
def test_user_create_google_redirect
orig_email = "redirect_tester_google_orig@google.com"
- verified_email = UsersController.message_hmac(orig_email)
+ email_hmac = UsersController.message_hmac(orig_email)
new_email = "redirect_tester_google@osm.org"
display_name = "redirect_tester_google"
auth_uid = "123454321"
assert_redirected_to auth_success_path(:provider => "google")
follow_redirect!
assert_redirected_to :controller => :users, :action => "new", :nickname => display_name,
- :email => orig_email, :verified_email => verified_email,
+ :email => orig_email, :email_hmac => email_hmac,
:auth_provider => "google", :auth_uid => auth_uid
follow_redirect!
post "/user/new",
:params => { :user => { :email => new_email,
- :verified_email => verified_email,
+ :email_hmac => email_hmac,
:display_name => display_name,
:auth_provider => "google",
:auth_uid => auth_uid,
def test_user_create_facebook_success
new_email = "newtester-facebook@osm.org"
- verified_email = UsersController.message_hmac(new_email)
+ email_hmac = UsersController.message_hmac(new_email)
display_name = "new_tester-facebook"
auth_uid = "123454321"
assert_redirected_to auth_success_path(:provider => "facebook")
follow_redirect!
assert_redirected_to :controller => :users, :action => "new", :nickname => display_name,
- :email => new_email, :verified_email => verified_email,
+ :email => new_email, :email_hmac => email_hmac,
:auth_provider => "facebook", :auth_uid => auth_uid
follow_redirect!
:auth_provider => "facebook",
:auth_uid => auth_uid,
:consider_pd => "1" },
- :verified_email => verified_email }
+ :email_hmac => email_hmac }
assert_redirected_to welcome_path
follow_redirect!
end
assert_redirected_to auth_success_path(:provider => "facebook")
follow_redirect!
assert_redirected_to :controller => :users, :action => "new", :nickname => display_name, :email => dup_user.email,
- :verified_email => UsersController.message_hmac(dup_user.email),
+ :email_hmac => UsersController.message_hmac(dup_user.email),
:auth_provider => "facebook", :auth_uid => auth_uid
follow_redirect!
def test_user_create_facebook_redirect
orig_email = "redirect_tester_facebook_orig@osm.org"
- verified_email = UsersController.message_hmac(orig_email)
+ email_hmac = UsersController.message_hmac(orig_email)
new_email = "redirect_tester_facebook@osm.org"
display_name = "redirect_tester_facebook"
auth_uid = "123454321"
assert_redirected_to auth_success_path(:provider => "facebook")
follow_redirect!
assert_redirected_to :controller => :users, :action => "new", :nickname => display_name,
- :email => orig_email, :verified_email => verified_email,
+ :email => orig_email, :email_hmac => email_hmac,
:auth_provider => "facebook", :auth_uid => auth_uid
follow_redirect!
post "/user/new",
:params => { :user => { :email => new_email,
- :verified_email => verified_email,
+ :email_hmac => email_hmac,
:display_name => display_name,
:auth_provider => "facebook",
:auth_uid => auth_uid,
def test_user_create_microsoft_success
new_email = "newtester-microsoft@osm.org"
- verified_email = UsersController.message_hmac(new_email)
+ email_hmac = UsersController.message_hmac(new_email)
display_name = "new_tester-microsoft"
auth_uid = "123454321"
assert_redirected_to auth_success_path(:provider => "microsoft")
follow_redirect!
assert_redirected_to :controller => :users, :action => "new", :nickname => display_name,
- :email => new_email, :verified_email => verified_email,
+ :email => new_email, :email_hmac => email_hmac,
:auth_provider => "microsoft", :auth_uid => auth_uid
follow_redirect!
post "/user/new",
:auth_provider => "microsoft",
:auth_uid => auth_uid,
:consider_pd => "1" },
- :verified_email => verified_email }
+ :email_hmac => email_hmac }
assert_redirected_to welcome_path
follow_redirect!
end
assert_redirected_to auth_success_path(:provider => "microsoft")
follow_redirect!
assert_redirected_to :controller => :users, :action => "new", :nickname => display_name, :email => dup_user.email,
- :verified_email => UsersController.message_hmac(dup_user.email),
+ :email_hmac => UsersController.message_hmac(dup_user.email),
:auth_provider => "microsoft", :auth_uid => auth_uid
follow_redirect!
def test_user_create_microsoft_redirect
orig_email = "redirect_tester_microsoft_orig@osm.org"
- verified_email = UsersController.message_hmac(orig_email)
+ email_hmac = UsersController.message_hmac(orig_email)
new_email = "redirect_tester_microsoft@osm.org"
display_name = "redirect_tester_microsoft"
auth_uid = "123454321"
assert_redirected_to auth_success_path(:provider => "microsoft")
follow_redirect!
assert_redirected_to :controller => :users, :action => "new", :nickname => display_name,
- :email => orig_email, :verified_email => verified_email,
+ :email => orig_email, :email_hmac => email_hmac,
:auth_provider => "microsoft", :auth_uid => auth_uid
follow_redirect!
post "/user/new",
:params => { :user => { :email => new_email,
- :verified_email => verified_email,
+ :email_hmac => email_hmac,
:display_name => display_name,
:auth_provider => "microsoft",
:auth_uid => auth_uid,
def test_user_create_github_success
new_email = "newtester-github@osm.org"
- verified_email = UsersController.message_hmac(new_email)
+ email_hmac = UsersController.message_hmac(new_email)
display_name = "new_tester-github"
password = "testtest"
auth_uid = "123454321"
assert_redirected_to auth_success_path(:provider => "github")
follow_redirect!
assert_redirected_to :controller => :users, :action => "new", :nickname => display_name,
- :email => new_email, :verified_email => verified_email,
+ :email => new_email, :email_hmac => email_hmac,
:auth_provider => "github", :auth_uid => auth_uid
follow_redirect!
:pass_crypt_confirmation => password },
:read_ct => 1,
:read_tou => 1,
- :verified_email => verified_email }
+ :email_hmac => email_hmac }
assert_redirected_to welcome_path
follow_redirect!
end
assert_redirected_to auth_success_path(:provider => "github")
follow_redirect!
assert_redirected_to :controller => :users, :action => "new", :nickname => display_name,
- :email => dup_user.email, :verified_email => UsersController.message_hmac(dup_user.email),
+ :email => dup_user.email, :email_hmac => UsersController.message_hmac(dup_user.email),
:auth_provider => "github", :auth_uid => auth_uid
follow_redirect!
def test_user_create_github_redirect
orig_email = "redirect_tester_github_orig@osm.org"
- verified_email = UsersController.message_hmac(orig_email)
+ email_hmac = UsersController.message_hmac(orig_email)
new_email = "redirect_tester_github@osm.org"
display_name = "redirect_tester_github"
auth_uid = "123454321"
assert_redirected_to auth_success_path(:provider => "github")
follow_redirect!
assert_redirected_to :controller => :users, :action => "new", :nickname => display_name,
- :email => orig_email, :verified_email => verified_email,
+ :email => orig_email, :email_hmac => email_hmac,
:auth_provider => "github", :auth_uid => auth_uid
follow_redirect!
post "/user/new",
:params => { :user => { :email => new_email,
- :verified_email => verified_email,
+ :email_hmac => email_hmac,
:display_name => display_name,
:auth_provider => "github",
:auth_uid => auth_uid,
def test_user_create_wikipedia_success
new_email = "newtester-wikipedia@osm.org"
- verified_email = UsersController.message_hmac(new_email)
+ email_hmac = UsersController.message_hmac(new_email)
display_name = "new_tester-wikipedia"
password = "testtest"
auth_uid = "123454321"
assert_redirected_to auth_success_path(:provider => "wikipedia", :origin => "/user/new")
follow_redirect!
assert_redirected_to :controller => :users, :action => "new", :nickname => display_name,
- :email => new_email, :verified_email => verified_email,
+ :email => new_email, :email_hmac => email_hmac,
:auth_provider => "wikipedia", :auth_uid => auth_uid
follow_redirect!
post "/user/new",
:pass_crypt_confirmation => password },
:read_ct => 1,
:read_tou => 1,
- :verified_email => verified_email }
+ :email_hmac => email_hmac }
assert_redirected_to welcome_path
follow_redirect!
end
assert_redirected_to auth_success_path(:provider => "wikipedia", :origin => "/user/new")
follow_redirect!
assert_redirected_to :controller => :users, :action => "new", :nickname => display_name,
- :email => dup_user.email, :verified_email => UsersController.message_hmac(dup_user.email),
+ :email => dup_user.email, :email_hmac => UsersController.message_hmac(dup_user.email),
:auth_provider => "wikipedia", :auth_uid => auth_uid
follow_redirect!
def test_user_create_wikipedia_redirect
orig_email = "redirect_tester_wikipedia_orig@osm.org"
- verified_email = UsersController.message_hmac(orig_email)
+ email_hmac = UsersController.message_hmac(orig_email)
new_email = "redirect_tester_wikipedia@osm.org"
display_name = "redirect_tester_wikipedia"
auth_uid = "123454321"
assert_redirected_to auth_success_path(:provider => "wikipedia", :origin => "/user/new")
follow_redirect!
assert_redirected_to :controller => :users, :action => "new", :nickname => display_name,
- :email => orig_email, :verified_email => verified_email,
+ :email => orig_email, :email_hmac => email_hmac,
:auth_provider => "wikipedia", :auth_uid => auth_uid
follow_redirect!
post "/user/new",
:params => { :user => { :email => new_email,
- :verified_email => verified_email,
+ :email_hmac => email_hmac,
:display_name => display_name,
:auth_provider => "wikipedia",
:auth_uid => auth_uid,