mirror of
https://github.com/openSUSE/osem.git
synced 2026-08-18 22:21:11 +00:00
The addition of a uniqueness validation on Organization#name is causing a lot of random failures; the Organization factory uses a Faker value, but appears to be producing repetitive results, so I've added a FactoryGirl sequence to ensure uniqueness.
13 lines
357 B
Ruby
13 lines
357 B
Ruby
FactoryGirl.define do
|
|
factory :organization do
|
|
sequence(:name) { |n| "#{Faker::Company.name} #{n}" }
|
|
description { Faker::Lorem.paragraph }
|
|
|
|
# after(:create) do |organization|
|
|
# File.open("spec/support/logos/#{1 + rand(13)}.png") do |file|
|
|
# organization.picture = file
|
|
# end
|
|
# organization.save!
|
|
# end
|
|
end
|
|
end
|