spec/factories/factories.rb in symphonia-3.3.0 vs spec/factories/factories.rb in symphonia-3.3.2

- old
+ new

@@ -1,10 +1,10 @@ FactoryBot.define do factory :user, class: 'Symphonia::User', aliases: [:author] do sequence(:first_name) { |n| "#{Faker::Name.first_name} #{n}" } sequence(:last_name) { |n| "#{Faker::Name.last_name} #{n}" } - sequence(:email) { |n| "#{n}" + Faker::Internet.email } + sequence(:email) { |n| "#{n}-#{Faker::Internet.email}" } login { email } admin { false } password { SecureRandom.hex(16) } last_request_at { Time.now } @@ -24,22 +24,10 @@ end factory :role, class: 'Symphonia::Role' do sequence(:name) { |n| "#{Faker::Job.title} #{n}" } end - - # factory :attachment, class: 'Symphonia::Attachment' do - # association :attachable, factory: :user - # end - # - # factory :file, parent: :attachment, class: 'Symphonia::CommonFile' do - # attachment { File.new(File.expand_path('../../support/common_file.txt', __FILE__)) } - # end - # - # factory :image, parent: :attachment, class: 'Symphonia::Image' do - # attachment { File.new(File.expand_path('../../support/symphonia.jpg', __FILE__)) } - # end - + factory :preference, class: 'Symphonia::Preference' do factory :email_preference, class: 'Symphonia::EmailPreference' do trait :user_registered do name { :notify_after_user_registered }