Manually assign notification_email
in the User factory when stubbed
Because we assign this value in the model via a callback conditionally on `email_changed?`, this never gets set when using `build_stubbed`, resulting in a "can't be blank" validation error on this field. In this case, we can just assign it manually to the same value as `email`, which is generated via a sequence.
This commit is contained in:
parent
cfabe7bf38
commit
76544283ea
1 changed files with 4 additions and 0 deletions
|
@ -8,6 +8,10 @@ FactoryGirl.define do
|
|||
confirmation_token { nil }
|
||||
can_create_group true
|
||||
|
||||
after(:stub) do |user|
|
||||
user.notification_email = user.email
|
||||
end
|
||||
|
||||
before(:create) do |user|
|
||||
user.ensure_rss_token
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue