FactoryGirl.define do
  factory :organization do
    name { Faker::Company.name }
    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

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

Make test organization names more unique
Make test organization names more unique

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.
