assert_difference "User.count", 1 do
assert_difference "ActionMailer::Base.deliveries.size", 1 do
- post :save, :session => { :new_user => user }
+ perform_enqueued_jobs do
+ post :save, :session => { :new_user => user }
+ end
end
end
assert_no_difference "User.count" do
assert_no_difference "ActionMailer::Base.deliveries.size" do
- post :save, :session => { :new_user => user }
+ perform_enqueued_jobs do
+ post :save, :session => { :new_user => user }
+ end
end
end
assert_no_difference "User.count" do
assert_no_difference "ActionMailer::Base.deliveries.size" do
- post :save, :session => { :new_user => user }
+ perform_enqueued_jobs do
+ post :save, :session => { :new_user => user }
+ end
end
end
assert_no_difference "User.count" do
assert_no_difference "ActionMailer::Base.deliveries.size" do
- post :save, :session => { :new_user => user }
+ perform_enqueued_jobs do
+ post :save, :session => { :new_user => user }
+ end
end
end
assert_no_difference "User.count" do
assert_no_difference "ActionMailer::Base.deliveries.size" do
- post :save, :session => { :new_user => user }
+ perform_enqueued_jobs do
+ post :save, :session => { :new_user => user }
+ end
end
end
assert_difference "User.count", 1 do
assert_difference "ActionMailer::Base.deliveries.size", 1 do
- post :save, :session => { :new_user => user,
- :referer => "/edit?editor=id#map=1/2/3" }
+ perform_enqueued_jobs do
+ post :save, :session => { :new_user => user,
+ :referer => "/edit?editor=id#map=1/2/3" }
+ end
end
end
session[:token] = user.tokens.create.token
assert_difference "ActionMailer::Base.deliveries.size", 1 do
- get :confirm_resend, :params => { :display_name => user.display_name }
+ perform_enqueued_jobs do
+ get :confirm_resend, :params => { :display_name => user.display_name }
+ end
end
assert_response :redirect
def test_confirm_resend_no_token
user = create(:user, :pending)
assert_no_difference "ActionMailer::Base.deliveries.size" do
- get :confirm_resend, :params => { :display_name => user.display_name }
+ perform_enqueued_jobs do
+ get :confirm_resend, :params => { :display_name => user.display_name }
+ end
end
assert_response :redirect
def test_confirm_resend_unknown_user
assert_no_difference "ActionMailer::Base.deliveries.size" do
- get :confirm_resend, :params => { :display_name => "No Such User" }
+ perform_enqueued_jobs do
+ get :confirm_resend, :params => { :display_name => "No Such User" }
+ end
end
assert_response :redirect
uppercase_user = build(:user, :email => user.email.upcase).tap { |u| u.save(:validate => false) }
assert_difference "ActionMailer::Base.deliveries.size", 1 do
- post :lost_password, :params => { :user => { :email => user.email } }
+ perform_enqueued_jobs do
+ post :lost_password, :params => { :user => { :email => user.email } }
+ end
end
assert_response :redirect
assert_redirected_to :action => :login
# Test resetting using an address that matches a different user
# that has the same address in a different case
assert_difference "ActionMailer::Base.deliveries.size", 1 do
- post :lost_password, :params => { :user => { :email => user.email.upcase } }
+ perform_enqueued_jobs do
+ post :lost_password, :params => { :user => { :email => user.email.upcase } }
+ end
end
assert_response :redirect
assert_redirected_to :action => :login
# Test resetting using an address that is a case insensitive match
# for more than one user but not an exact match for either
assert_no_difference "ActionMailer::Base.deliveries.size" do
- post :lost_password, :params => { :user => { :email => user.email.titlecase } }
+ perform_enqueued_jobs do
+ post :lost_password, :params => { :user => { :email => user.email.titlecase } }
+ end
end
assert_response :success
assert_template :lost_password
# address which is case insensitively unique
third_user = create(:user)
assert_difference "ActionMailer::Base.deliveries.size", 1 do
- post :lost_password, :params => { :user => { :email => third_user.email } }
+ perform_enqueued_jobs do
+ post :lost_password, :params => { :user => { :email => third_user.email } }
+ end
end
assert_response :redirect
assert_redirected_to :action => :login
# Test resetting using an address that matches a user that has the
# same (case insensitively unique) address in a different case
assert_difference "ActionMailer::Base.deliveries.size", 1 do
- post :lost_password, :params => { :user => { :email => third_user.email.upcase } }
+ perform_enqueued_jobs do
+ post :lost_password, :params => { :user => { :email => third_user.email.upcase } }
+ end
end
assert_response :redirect
assert_redirected_to :action => :login
# Changing email to one that exists should fail
user.new_email = create(:user).email
assert_no_difference "ActionMailer::Base.deliveries.size" do
- post :account, :params => { :display_name => user.display_name, :user => user.attributes }, :session => { :user => user }
+ perform_enqueued_jobs do
+ post :account, :params => { :display_name => user.display_name, :user => user.attributes }, :session => { :user => user }
+ end
end
assert_response :success
assert_template :account
# Changing email to one that exists should fail, regardless of case
user.new_email = create(:user).email.upcase
assert_no_difference "ActionMailer::Base.deliveries.size" do
- post :account, :params => { :display_name => user.display_name, :user => user.attributes }, :session => { :user => user }
+ perform_enqueued_jobs do
+ post :account, :params => { :display_name => user.display_name, :user => user.attributes }, :session => { :user => user }
+ end
end
assert_response :success
assert_template :account
# Changing email to one that doesn't exist should work
user.new_email = "new_tester@example.com"
assert_difference "ActionMailer::Base.deliveries.size", 1 do
- post :account, :params => { :display_name => user.display_name, :user => user.attributes }, :session => { :user => user }
+ perform_enqueued_jobs do
+ post :account, :params => { :display_name => user.display_name, :user => user.attributes }, :session => { :user => user }
+ end
end
assert_response :success
assert_template :account
# When logged in a POST should add the friendship
assert_difference "ActionMailer::Base.deliveries.size", 1 do
- post :make_friend, :params => { :display_name => friend.display_name }, :session => { :user => user }
+ perform_enqueued_jobs do
+ post :make_friend, :params => { :display_name => friend.display_name }, :session => { :user => user }
+ end
end
assert_redirected_to user_path(friend)
assert_match(/is now your friend/, flash[:notice])
# A second POST should report that the friendship already exists
assert_no_difference "ActionMailer::Base.deliveries.size" do
- post :make_friend, :params => { :display_name => friend.display_name }, :session => { :user => user }
+ perform_enqueued_jobs do
+ post :make_friend, :params => { :display_name => friend.display_name }, :session => { :user => user }
+ end
end
assert_redirected_to user_path(friend)
assert_match(/You are already friends with/, flash[:warning])
# When logged in a POST should add the friendship and refer us
assert_difference "ActionMailer::Base.deliveries.size", 1 do
- post :make_friend, :params => { :display_name => friend.display_name, :referer => "/test" }, :session => { :user => user }
+ perform_enqueued_jobs do
+ post :make_friend, :params => { :display_name => friend.display_name, :referer => "/test" }, :session => { :user => user }
+ end
end
assert_redirected_to "/test"
assert_match(/is now your friend/, flash[:notice])
display_name = "#{locale}_new_tester"
assert_difference("User.count", 0) do
assert_difference("ActionMailer::Base.deliveries.size", 0) do
- post "/user/new",
- :params => { :user => { :email => dup_email, :email_confirmation => dup_email, :display_name => display_name, :pass_crypt => "testtest", :pass_crypt_confirmation => "testtest" } },
- :headers => { "HTTP_ACCEPT_LANGUAGE" => locale.to_s }
+ perform_enqueued_jobs do
+ post "/user/new",
+ :params => { :user => { :email => dup_email, :email_confirmation => dup_email, :display_name => display_name, :pass_crypt => "testtest", :pass_crypt_confirmation => "testtest" } },
+ :headers => { "HTTP_ACCEPT_LANGUAGE" => locale.to_s }
+ end
end
end
assert_response :success
email = "#{locale}_new_tester"
assert_difference("User.count", 0) do
assert_difference("ActionMailer::Base.deliveries.size", 0) do
- post "/user/new",
- :params => { :user => { :email => email, :email_confirmation => email, :display_name => dup_display_name, :pass_crypt => "testtest", :pass_crypt_confirmation => "testtest" } },
- :headers => { "HTTP_ACCEPT_LANGUAGE" => locale.to_s }
+ perform_enqueued_jobs do
+ post "/user/new",
+ :params => { :user => { :email => email, :email_confirmation => email, :display_name => dup_display_name, :pass_crypt => "testtest", :pass_crypt_confirmation => "testtest" } },
+ :headers => { "HTTP_ACCEPT_LANGUAGE" => locale.to_s }
+ end
end
end
assert_response :success
assert_difference("User.count", 0) do
assert_difference("ActionMailer::Base.deliveries.size", 0) do
- post "/user/new",
- :params => { :user => { :email => new_email, :email_confirmation => new_email, :display_name => display_name, :pass_crypt => "testtest", :pass_crypt_confirmation => "testtest" } }
+ 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_difference("User.count") do
assert_difference("ActionMailer::Base.deliveries.size", 1) do
- post "/user/save",
- :headers => { "HTTP_ACCEPT_LANGUAGE" => locale.to_s }
- follow_redirect!
+ perform_enqueued_jobs do
+ post "/user/save",
+ :headers => { "HTTP_ACCEPT_LANGUAGE" => locale.to_s }
+ follow_redirect!
+ end
end
end
referer = "/traces/mine"
assert_difference("User.count") do
assert_difference("ActionMailer::Base.deliveries.size", 1) do
- post "/user/new",
- :params => { :user => { :email => new_email, :email_confirmation => new_email, :display_name => display_name, :pass_crypt => password, :pass_crypt_confirmation => password }, :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 } }
- follow_redirect!
+ perform_enqueued_jobs do
+ post "/user/new",
+ :params => { :user => { :email => new_email, :email_confirmation => new_email, :display_name => display_name, :pass_crypt => password, :pass_crypt_confirmation => password }, :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 } }
+ follow_redirect!
+ end
end
end
password = "testtest"
assert_difference("User.count") do
assert_difference("ActionMailer::Base.deliveries.size", 1) do
- post "/user/new",
- :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 => "", :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 "/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 } }
- assert_response :redirect
- follow_redirect!
+ perform_enqueued_jobs do
+ post "/user/new",
+ :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 => "", :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 "/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 } }
+ assert_response :redirect
+ follow_redirect!
+ end
end
end
display_name = "new_tester-openid2"
assert_difference("User.count", 0) do
assert_difference("ActionMailer::Base.deliveries.size", 0) do
- post "/user/new",
- :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 => "", :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!
- assert_response :redirect
- follow_redirect!
- assert_response :success
- assert_template "users/new"
+ perform_enqueued_jobs do
+ post "/user/new",
+ :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 => "", :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!
+ assert_response :redirect
+ follow_redirect!
+ assert_response :success
+ assert_template "users/new"
+ end
end
end
referer = "/traces/mine"
assert_difference("User.count") do
assert_difference("ActionMailer::Base.deliveries.size", 1) do
- post "/user/new",
- :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 => "", :pass_crypt_confirmation => "" }, :referer => referer }
- 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 "/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" } }
- follow_redirect!
+ perform_enqueued_jobs do
+ post "/user/new",
+ :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 => "", :pass_crypt_confirmation => "" }, :referer => referer }
+ 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 "/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" } }
+ follow_redirect!
+ end
end
end
password = "testtest"
assert_difference("User.count") do
assert_difference("ActionMailer::Base.deliveries.size", 1) do
- post "/user/new",
- :params => { :user => { :email => new_email, :email_confirmation => new_email, :display_name => display_name, :auth_provider => "google", :pass_crypt => "", :pass_crypt_confirmation => "" } }
- assert_response :redirect
- assert_redirected_to auth_path(:provider => "google", :origin => "/user/new")
- follow_redirect!
- assert_response :redirect
- assert_redirected_to auth_success_path(:provider => "google")
- follow_redirect!
- assert_response :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 } }
- assert_response :redirect
- follow_redirect!
+ perform_enqueued_jobs do
+ post "/user/new",
+ :params => { :user => { :email => new_email, :email_confirmation => new_email, :display_name => display_name, :auth_provider => "google", :pass_crypt => "", :pass_crypt_confirmation => "" } }
+ assert_response :redirect
+ assert_redirected_to auth_path(:provider => "google", :origin => "/user/new")
+ follow_redirect!
+ assert_response :redirect
+ assert_redirected_to auth_success_path(:provider => "google")
+ follow_redirect!
+ assert_response :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 } }
+ assert_response :redirect
+ follow_redirect!
+ end
end
end
display_name = "new_tester-google2"
assert_difference("User.count", 0) do
assert_difference("ActionMailer::Base.deliveries.size", 0) do
- post "/user/new",
- :params => { :user => { :email => new_email, :email_confirmation => new_email, :display_name => display_name, :auth_provider => "google", :pass_crypt => "", :pass_crypt_confirmation => "" } }
- assert_response :redirect
- assert_redirected_to auth_path(:provider => "google", :origin => "/user/new")
- follow_redirect!
- assert_response :redirect
- assert_redirected_to auth_success_path(:provider => "google")
- follow_redirect!
- assert_response :redirect
- assert_redirected_to auth_failure_path(:strategy => "google", :message => "connection_failed", :origin => "/user/new")
- follow_redirect!
- assert_response :redirect
- follow_redirect!
- assert_response :success
- assert_template "users/new"
+ perform_enqueued_jobs do
+ post "/user/new",
+ :params => { :user => { :email => new_email, :email_confirmation => new_email, :display_name => display_name, :auth_provider => "google", :pass_crypt => "", :pass_crypt_confirmation => "" } }
+ assert_response :redirect
+ assert_redirected_to auth_path(:provider => "google", :origin => "/user/new")
+ follow_redirect!
+ assert_response :redirect
+ assert_redirected_to auth_success_path(:provider => "google")
+ follow_redirect!
+ assert_response :redirect
+ assert_redirected_to auth_failure_path(:strategy => "google", :message => "connection_failed", :origin => "/user/new")
+ follow_redirect!
+ assert_response :redirect
+ follow_redirect!
+ assert_response :success
+ assert_template "users/new"
+ end
end
end
referer = "/traces/mine"
assert_difference("User.count") do
assert_difference("ActionMailer::Base.deliveries.size", 1) do
- post "/user/new",
- :params => { :user => { :email => new_email, :email_confirmation => new_email, :display_name => display_name, :auth_provider => "google", :pass_crypt => "", :pass_crypt_confirmation => "" }, :referer => referer }
- assert_response :redirect
- assert_redirected_to auth_path(:provider => "google", :origin => "/user/new")
- follow_redirect!
- assert_response :redirect
- assert_redirected_to auth_success_path(:provider => "google")
- follow_redirect!
- assert_response :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" } }
- follow_redirect!
+ perform_enqueued_jobs do
+ post "/user/new",
+ :params => { :user => { :email => new_email, :email_confirmation => new_email, :display_name => display_name, :auth_provider => "google", :pass_crypt => "", :pass_crypt_confirmation => "" }, :referer => referer }
+ assert_response :redirect
+ assert_redirected_to auth_path(:provider => "google", :origin => "/user/new")
+ follow_redirect!
+ assert_response :redirect
+ assert_redirected_to auth_success_path(:provider => "google")
+ follow_redirect!
+ assert_response :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" } }
+ follow_redirect!
+ end
end
end
password = "testtest"
assert_difference("User.count") do
assert_difference("ActionMailer::Base.deliveries.size", 1) do
- post "/user/new",
- :params => { :user => { :email => new_email, :email_confirmation => new_email, :display_name => display_name, :auth_provider => "facebook", :pass_crypt => "", :pass_crypt_confirmation => "" } }
- assert_response :redirect
- assert_redirected_to auth_path(:provider => "facebook", :origin => "/user/new")
- follow_redirect!
- assert_response :redirect
- assert_redirected_to auth_success_path(:provider => "facebook")
- follow_redirect!
- assert_response :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 } }
- assert_response :redirect
- follow_redirect!
+ perform_enqueued_jobs do
+ post "/user/new",
+ :params => { :user => { :email => new_email, :email_confirmation => new_email, :display_name => display_name, :auth_provider => "facebook", :pass_crypt => "", :pass_crypt_confirmation => "" } }
+ assert_response :redirect
+ assert_redirected_to auth_path(:provider => "facebook", :origin => "/user/new")
+ follow_redirect!
+ assert_response :redirect
+ assert_redirected_to auth_success_path(:provider => "facebook")
+ follow_redirect!
+ assert_response :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 } }
+ assert_response :redirect
+ follow_redirect!
+ end
end
end
display_name = "new_tester-facebook2"
assert_difference("User.count", 0) do
assert_difference("ActionMailer::Base.deliveries.size", 0) do
- post "/user/new",
- :params => { :user => { :email => new_email, :email_confirmation => new_email, :display_name => display_name, :auth_provider => "facebook", :pass_crypt => "", :pass_crypt_confirmation => "" } }
- assert_response :redirect
- assert_redirected_to auth_path(:provider => "facebook", :origin => "/user/new")
- follow_redirect!
- assert_response :redirect
- assert_redirected_to auth_success_path(:provider => "facebook")
- follow_redirect!
- assert_response :redirect
- assert_redirected_to auth_failure_path(:strategy => "facebook", :message => "connection_failed", :origin => "/user/new")
- follow_redirect!
- assert_response :redirect
- follow_redirect!
- assert_response :success
- assert_template "users/new"
+ perform_enqueued_jobs do
+ post "/user/new",
+ :params => { :user => { :email => new_email, :email_confirmation => new_email, :display_name => display_name, :auth_provider => "facebook", :pass_crypt => "", :pass_crypt_confirmation => "" } }
+ assert_response :redirect
+ assert_redirected_to auth_path(:provider => "facebook", :origin => "/user/new")
+ follow_redirect!
+ assert_response :redirect
+ assert_redirected_to auth_success_path(:provider => "facebook")
+ follow_redirect!
+ assert_response :redirect
+ assert_redirected_to auth_failure_path(:strategy => "facebook", :message => "connection_failed", :origin => "/user/new")
+ follow_redirect!
+ assert_response :redirect
+ follow_redirect!
+ assert_response :success
+ assert_template "users/new"
+ end
end
end
referer = "/traces/mine"
assert_difference("User.count") do
assert_difference("ActionMailer::Base.deliveries.size", 1) do
- post "/user/new",
- :params => { :user => { :email => new_email, :email_confirmation => new_email, :display_name => display_name, :auth_provider => "facebook", :pass_crypt => "", :pass_crypt_confirmation => "" }, :referer => referer }
- assert_response :redirect
- assert_redirected_to auth_path(:provider => "facebook", :origin => "/user/new")
- follow_redirect!
- assert_response :redirect
- assert_redirected_to auth_success_path(:provider => "facebook")
- follow_redirect!
- assert_response :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" } }
- follow_redirect!
+ perform_enqueued_jobs do
+ post "/user/new",
+ :params => { :user => { :email => new_email, :email_confirmation => new_email, :display_name => display_name, :auth_provider => "facebook", :pass_crypt => "", :pass_crypt_confirmation => "" }, :referer => referer }
+ assert_response :redirect
+ assert_redirected_to auth_path(:provider => "facebook", :origin => "/user/new")
+ follow_redirect!
+ assert_response :redirect
+ assert_redirected_to auth_success_path(:provider => "facebook")
+ follow_redirect!
+ assert_response :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" } }
+ follow_redirect!
+ end
end
end
password = "testtest"
assert_difference("User.count") do
assert_difference("ActionMailer::Base.deliveries.size", 1) do
- post "/user/new",
- :params => { :user => { :email => new_email, :email_confirmation => new_email, :display_name => display_name, :auth_provider => "windowslive", :pass_crypt => "", :pass_crypt_confirmation => "" } }
- assert_response :redirect
- assert_redirected_to auth_path(:provider => "windowslive", :origin => "/user/new")
- follow_redirect!
- assert_response :redirect
- assert_redirected_to auth_success_path(:provider => "windowslive")
- follow_redirect!
- assert_response :redirect
- assert_redirected_to "/user/terms"
- post "/user/save",
- :params => { :user => { :email => new_email, :email_confirmation => new_email, :display_name => display_name, :auth_provider => "windowslive", :auth_uid => "123454321", :pass_crypt => password, :pass_crypt_confirmation => password } }
- assert_response :redirect
- follow_redirect!
+ perform_enqueued_jobs do
+ post "/user/new",
+ :params => { :user => { :email => new_email, :email_confirmation => new_email, :display_name => display_name, :auth_provider => "windowslive", :pass_crypt => "", :pass_crypt_confirmation => "" } }
+ assert_response :redirect
+ assert_redirected_to auth_path(:provider => "windowslive", :origin => "/user/new")
+ follow_redirect!
+ assert_response :redirect
+ assert_redirected_to auth_success_path(:provider => "windowslive")
+ follow_redirect!
+ assert_response :redirect
+ assert_redirected_to "/user/terms"
+ post "/user/save",
+ :params => { :user => { :email => new_email, :email_confirmation => new_email, :display_name => display_name, :auth_provider => "windowslive", :auth_uid => "123454321", :pass_crypt => password, :pass_crypt_confirmation => password } }
+ assert_response :redirect
+ follow_redirect!
+ end
end
end
display_name = "new_tester-windowslive2"
assert_difference("User.count", 0) do
assert_difference("ActionMailer::Base.deliveries.size", 0) do
- post "/user/new",
- :params => { :user => { :email => new_email, :email_confirmation => new_email, :display_name => display_name, :auth_provider => "windowslive", :pass_crypt => "", :pass_crypt_confirmation => "" } }
- assert_response :redirect
- assert_redirected_to auth_path(:provider => "windowslive", :origin => "/user/new")
- follow_redirect!
- assert_response :redirect
- assert_redirected_to auth_success_path(:provider => "windowslive")
- follow_redirect!
- assert_response :redirect
- assert_redirected_to auth_failure_path(:strategy => "windowslive", :message => "connection_failed", :origin => "/user/new")
- follow_redirect!
- assert_response :redirect
- follow_redirect!
- assert_response :success
- assert_template "users/new"
+ perform_enqueued_jobs do
+ post "/user/new",
+ :params => { :user => { :email => new_email, :email_confirmation => new_email, :display_name => display_name, :auth_provider => "windowslive", :pass_crypt => "", :pass_crypt_confirmation => "" } }
+ assert_response :redirect
+ assert_redirected_to auth_path(:provider => "windowslive", :origin => "/user/new")
+ follow_redirect!
+ assert_response :redirect
+ assert_redirected_to auth_success_path(:provider => "windowslive")
+ follow_redirect!
+ assert_response :redirect
+ assert_redirected_to auth_failure_path(:strategy => "windowslive", :message => "connection_failed", :origin => "/user/new")
+ follow_redirect!
+ assert_response :redirect
+ follow_redirect!
+ assert_response :success
+ assert_template "users/new"
+ end
end
end
referer = "/traces/mine"
assert_difference("User.count") do
assert_difference("ActionMailer::Base.deliveries.size", 1) do
- post "/user/new",
- :params => { :user => { :email => new_email, :email_confirmation => new_email, :display_name => display_name, :auth_provider => "windowslive", :pass_crypt => "", :pass_crypt_confirmation => "" }, :referer => referer }
- assert_response :redirect
- assert_redirected_to auth_path(:provider => "windowslive", :origin => "/user/new")
- follow_redirect!
- assert_response :redirect
- assert_redirected_to auth_success_path(:provider => "windowslive")
- follow_redirect!
- assert_response :redirect
- assert_redirected_to "/user/terms"
- post "/user/save",
- :params => { :user => { :email => new_email, :email_confirmation => new_email, :display_name => display_name, :auth_provider => "windowslive", :auth_uid => "http://localhost:1123/new.tester", :pass_crypt => "testtest", :pass_crypt_confirmation => "testtest" } }
- follow_redirect!
+ perform_enqueued_jobs do
+ post "/user/new",
+ :params => { :user => { :email => new_email, :email_confirmation => new_email, :display_name => display_name, :auth_provider => "windowslive", :pass_crypt => "", :pass_crypt_confirmation => "" }, :referer => referer }
+ assert_response :redirect
+ assert_redirected_to auth_path(:provider => "windowslive", :origin => "/user/new")
+ follow_redirect!
+ assert_response :redirect
+ assert_redirected_to auth_success_path(:provider => "windowslive")
+ follow_redirect!
+ assert_response :redirect
+ assert_redirected_to "/user/terms"
+ post "/user/save",
+ :params => { :user => { :email => new_email, :email_confirmation => new_email, :display_name => display_name, :auth_provider => "windowslive", :auth_uid => "http://localhost:1123/new.tester", :pass_crypt => "testtest", :pass_crypt_confirmation => "testtest" } }
+ follow_redirect!
+ end
end
end
password = "testtest"
assert_difference("User.count") do
assert_difference("ActionMailer::Base.deliveries.size", 1) do
- post "/user/new",
- :params => { :user => { :email => new_email, :email_confirmation => new_email, :display_name => display_name, :auth_provider => "github", :pass_crypt => "", :pass_crypt_confirmation => "" } }
- assert_response :redirect
- assert_redirected_to auth_path(:provider => "github", :origin => "/user/new")
- follow_redirect!
- assert_response :redirect
- assert_redirected_to auth_success_path(:provider => "github")
- follow_redirect!
- assert_response :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 } }
- assert_response :redirect
- follow_redirect!
+ perform_enqueued_jobs do
+ post "/user/new",
+ :params => { :user => { :email => new_email, :email_confirmation => new_email, :display_name => display_name, :auth_provider => "github", :pass_crypt => "", :pass_crypt_confirmation => "" } }
+ assert_response :redirect
+ assert_redirected_to auth_path(:provider => "github", :origin => "/user/new")
+ follow_redirect!
+ assert_response :redirect
+ assert_redirected_to auth_success_path(:provider => "github")
+ follow_redirect!
+ assert_response :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 } }
+ assert_response :redirect
+ follow_redirect!
+ end
end
end
display_name = "new_tester-github2"
assert_difference("User.count", 0) do
assert_difference("ActionMailer::Base.deliveries.size", 0) do
- post "/user/new",
- :params => { :user => { :email => new_email, :email_confirmation => new_email, :display_name => display_name, :auth_provider => "github", :pass_crypt => "", :pass_crypt_confirmation => "" } }
- assert_response :redirect
- assert_redirected_to auth_path(:provider => "github", :origin => "/user/new")
- follow_redirect!
- assert_response :redirect
- assert_redirected_to auth_success_path(:provider => "github")
- follow_redirect!
- assert_response :redirect
- assert_redirected_to auth_failure_path(:strategy => "github", :message => "connection_failed", :origin => "/user/new")
- follow_redirect!
- assert_response :redirect
- follow_redirect!
- assert_response :success
- assert_template "users/new"
+ perform_enqueued_jobs do
+ post "/user/new",
+ :params => { :user => { :email => new_email, :email_confirmation => new_email, :display_name => display_name, :auth_provider => "github", :pass_crypt => "", :pass_crypt_confirmation => "" } }
+ assert_response :redirect
+ assert_redirected_to auth_path(:provider => "github", :origin => "/user/new")
+ follow_redirect!
+ assert_response :redirect
+ assert_redirected_to auth_success_path(:provider => "github")
+ follow_redirect!
+ assert_response :redirect
+ assert_redirected_to auth_failure_path(:strategy => "github", :message => "connection_failed", :origin => "/user/new")
+ follow_redirect!
+ assert_response :redirect
+ follow_redirect!
+ assert_response :success
+ assert_template "users/new"
+ end
end
end
referer = "/traces/mine"
assert_difference("User.count") do
assert_difference("ActionMailer::Base.deliveries.size", 1) do
- post "/user/new",
- :params => { :user => { :email => new_email, :email_confirmation => new_email, :display_name => display_name, :auth_provider => "github", :pass_crypt => "", :pass_crypt_confirmation => "" }, :referer => referer }
- assert_response :redirect
- assert_redirected_to auth_path(:provider => "github", :origin => "/user/new")
- follow_redirect!
- assert_response :redirect
- assert_redirected_to auth_success_path(:provider => "github")
- follow_redirect!
- assert_response :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" } }
- follow_redirect!
+ perform_enqueued_jobs do
+ post "/user/new",
+ :params => { :user => { :email => new_email, :email_confirmation => new_email, :display_name => display_name, :auth_provider => "github", :pass_crypt => "", :pass_crypt_confirmation => "" }, :referer => referer }
+ assert_response :redirect
+ assert_redirected_to auth_path(:provider => "github", :origin => "/user/new")
+ follow_redirect!
+ assert_response :redirect
+ assert_redirected_to auth_success_path(:provider => "github")
+ follow_redirect!
+ assert_response :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" } }
+ follow_redirect!
+ end
end
end
password = "testtest"
assert_difference("User.count") do
assert_difference("ActionMailer::Base.deliveries.size", 1) do
- post "/user/new",
- :params => { :user => { :email => new_email, :email_confirmation => new_email, :display_name => display_name, :auth_provider => "wikipedia", :pass_crypt => "", :pass_crypt_confirmation => "" } }
- assert_response :redirect
- assert_redirected_to auth_path(:provider => "wikipedia", :origin => "/user/new")
- follow_redirect!
- assert_response :redirect
- assert_redirected_to auth_success_path(:provider => "wikipedia", :origin => "/user/new")
- follow_redirect!
- assert_response :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 } }
- assert_response :redirect
- follow_redirect!
+ perform_enqueued_jobs do
+ post "/user/new",
+ :params => { :user => { :email => new_email, :email_confirmation => new_email, :display_name => display_name, :auth_provider => "wikipedia", :pass_crypt => "", :pass_crypt_confirmation => "" } }
+ assert_response :redirect
+ assert_redirected_to auth_path(:provider => "wikipedia", :origin => "/user/new")
+ follow_redirect!
+ assert_response :redirect
+ assert_redirected_to auth_success_path(:provider => "wikipedia", :origin => "/user/new")
+ follow_redirect!
+ assert_response :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 } }
+ assert_response :redirect
+ follow_redirect!
+ end
end
end
display_name = "new_tester-wikipedia2"
assert_difference("User.count", 0) do
assert_difference("ActionMailer::Base.deliveries.size", 0) do
- post "/user/new",
- :params => { :user => { :email => new_email, :email_confirmation => new_email, :display_name => display_name, :auth_provider => "wikipedia", :pass_crypt => "", :pass_crypt_confirmation => "" } }
- assert_response :redirect
- assert_redirected_to auth_path(:provider => "wikipedia", :origin => "/user/new")
- follow_redirect!
- assert_response :redirect
- assert_redirected_to auth_success_path(:provider => "wikipedia", :origin => "/user/new")
- follow_redirect!
- assert_response :redirect
- assert_redirected_to auth_failure_path(:strategy => "wikipedia", :message => "connection_failed", :origin => "/user/new")
- follow_redirect!
- assert_response :redirect
- follow_redirect!
- assert_response :success
- assert_template "users/new"
+ perform_enqueued_jobs do
+ post "/user/new",
+ :params => { :user => { :email => new_email, :email_confirmation => new_email, :display_name => display_name, :auth_provider => "wikipedia", :pass_crypt => "", :pass_crypt_confirmation => "" } }
+ assert_response :redirect
+ assert_redirected_to auth_path(:provider => "wikipedia", :origin => "/user/new")
+ follow_redirect!
+ assert_response :redirect
+ assert_redirected_to auth_success_path(:provider => "wikipedia", :origin => "/user/new")
+ follow_redirect!
+ assert_response :redirect
+ assert_redirected_to auth_failure_path(:strategy => "wikipedia", :message => "connection_failed", :origin => "/user/new")
+ follow_redirect!
+ assert_response :redirect
+ follow_redirect!
+ assert_response :success
+ assert_template "users/new"
+ end
end
end
referer = "/traces/mine"
assert_difference("User.count") do
assert_difference("ActionMailer::Base.deliveries.size", 1) do
- post "/user/new",
- :params => { :user => { :email => new_email, :email_confirmation => new_email, :display_name => display_name, :auth_provider => "wikipedia", :pass_crypt => "", :pass_crypt_confirmation => "" }, :referer => referer }
- assert_response :redirect
- assert_redirected_to auth_path(:provider => "wikipedia", :origin => "/user/new")
- follow_redirect!
- assert_response :redirect
- assert_redirected_to auth_success_path(:provider => "wikipedia", :origin => "/user/new")
- follow_redirect!
- assert_response :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" } }
- follow_redirect!
+ perform_enqueued_jobs do
+ post "/user/new",
+ :params => { :user => { :email => new_email, :email_confirmation => new_email, :display_name => display_name, :auth_provider => "wikipedia", :pass_crypt => "", :pass_crypt_confirmation => "" }, :referer => referer }
+ assert_response :redirect
+ assert_redirected_to auth_path(:provider => "wikipedia", :origin => "/user/new")
+ follow_redirect!
+ assert_response :redirect
+ assert_redirected_to auth_success_path(:provider => "wikipedia", :origin => "/user/new")
+ follow_redirect!
+ assert_response :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" } }
+ follow_redirect!
+ end
end
end