Added test case for nickname registration failure

* Also made a minor readability change by moving the auth.present? check
* from UsersController#create into #create_third_party_auth_records
* which is the method that relies on the check.
This commit is contained in:
Einar Jonsson
2013-08-25 20:18:07 +00:00
parent b32e87c929
commit 0d22a77c63
2 changed files with 18 additions and 1 deletions
+3 -1
View File
@@ -167,7 +167,7 @@ class UsersController < ApplicationController
if user.save
activator = UserActivator.new(user, session, cookies)
message = activator.activation_message
create_third_party_auth_records(user, auth) if auth.present?
create_third_party_auth_records(user, auth)
# Clear authentication session.
session[:authentication] = nil
@@ -408,6 +408,8 @@ class UsersController < ApplicationController
end
def create_third_party_auth_records(user, auth)
return unless auth.present?
if twitter_auth?(auth)
TwitterUserInfo.create(
user_id: user.id,