diff options
Diffstat (limited to 'spec/factories/users.rb')
-rw-r--r-- | spec/factories/users.rb | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/spec/factories/users.rb b/spec/factories/users.rb index e60fe713bc3..769fd656e7a 100644 --- a/spec/factories/users.rb +++ b/spec/factories/users.rb @@ -1,5 +1,5 @@ -FactoryGirl.define do - factory :user, aliases: [:author, :assignee, :recipient, :owner, :creator, :resource_owner] do +FactoryBot.define do + factory :user, aliases: [:author, :assignee, :recipient, :owner, :resource_owner] do email { generate(:email) } name { generate(:name) } username { generate(:username) } @@ -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 @@ -34,7 +38,7 @@ FactoryGirl.define do end trait :with_avatar do - avatar { File.open(Rails.root.join('spec/fixtures/dk.png')) } + avatar { fixture_file_upload('spec/fixtures/dk.png') } end trait :two_factor_via_otp do @@ -54,6 +58,10 @@ FactoryGirl.define do end end + trait :readme do + project_view :readme + end + factory :omniauth_user do transient do extern_uid '123456' |