- def test_user_create_association_bad_auth_provider
- assert_difference("User.count", 0) do
- assert_no_difference("ActionMailer::Base.deliveries.size") do
- perform_enqueued_jobs do
- post "/user/new",
- :params => { :user => { :email => "test@example.com",
- :display_name => "new_tester",
- :pass_crypt => "testtest",
- :pass_crypt_confirmation => "testtest",
- :auth_provider => "noprovider",
- :auth_uid => "123454321",
- :consider_pd => "1" } }
- assert_redirected_to auth_path(:provider => "noprovider", :origin => "/user/new")
- post response.location
- end
- end
- end
- assert_response :not_found
- end
-
- def test_user_create_association_no_auth_uid
- OmniAuth.config.mock_auth[:google] = :invalid_credentials
- assert_difference("User.count", 0) do
- assert_no_difference("ActionMailer::Base.deliveries.size") do
- perform_enqueued_jobs do
- post "/user/new",
- :params => { :user => { :email => "test@example.com",
- :display_name => "new_tester",
- :pass_crypt => "testtest",
- :pass_crypt_confirmation => "testtest",
- :auth_provider => "google",
- :consider_pd => "1" } }
- assert_redirected_to auth_path(:provider => "google", :origin => "/user/new")
- post response.location
- end
- end
- end
- follow_redirect!
- assert_redirected_to auth_failure_path(:strategy => "google", :message => "invalid_credentials", :origin => "/user/new")
- end
-