make sure UsersController#create creates account assocations
refs #5833 Change-Id: I76e2e6879e33cc61752e084ec5d94ca9069fc0f6 Reviewed-on: https://gerrit.instructure.com/6586 Tested-by: Hudson <hudson@instructure.com> Reviewed-by: Bryan Madsen <bryan@instructure.com>
This commit is contained in:
parent
7be2641834
commit
b6fca29032
|
@ -499,6 +499,8 @@ class UsersController < ApplicationController
|
|||
@user.name ||= params[:pseudonym][:unique_id]
|
||||
|
||||
@pseudonym ||= @user.pseudonyms.build(:account => @context)
|
||||
# pre-populate the reverse association
|
||||
@pseudonym.user = @user
|
||||
@pseudonym.attributes = params[:pseudonym]
|
||||
@pseudonym.account = @context
|
||||
@pseudonym.workflow_state = 'active'
|
||||
|
|
|
@ -87,6 +87,7 @@ describe UsersController do
|
|||
p.user.communication_channels.length.should == 1
|
||||
p.user.communication_channels.first.should be_unconfirmed
|
||||
p.user.communication_channels.first.path.should == 'jacob@instructure.com'
|
||||
p.user.associated_accounts.should == [Account.default]
|
||||
end
|
||||
|
||||
it "should complain about conflicting unique_ids" do
|
||||
|
|
Loading…
Reference in New Issue