Sha256: a660b8311e3e806e94a329e9da4ce5ffb33a3c2347bc610237eb0369cd7c5fe6

Contents?: true

Size: 1010 Bytes

Versions: 7

Compression:

Stored size: 1010 Bytes

Contents

# frozen_string_literal: true

FactoryGirl.define do
  factory :artist, :class => MetalArchives::Artist do
    id { Faker::Number.number [1, 2, 3, 4].sample }
    name { Faker::Name.name }
    gender { %i[male female].sample }
    biography { Faker::Lorem.words(200).join ' ' }
    trivia { Faker::Lorem.words(200).join ' ' }

    country { ISO3166::Country[Faker::Address.country_code] }
    location { Faker::Address.city }

    date_of_birth { Faker::Date.birthday 18, 65 }

    links do
      3.times.collect do
        {
          :url => Faker::Internet.url,
          :type => %i[official unofficial unlisted_bands].sample,
          :title => Faker::Lorem.words(4).join(' ')
        }
      end
    end

    trait :has_died do
      date_of_death { Faker::Date.between date_of_birth, Date.today }
      cause_of_death { %w(Suicide N/A Accident Cancer Illness Murder).sample }
    end

    trait :with_aliases do
      aliases do
        3.times.collect { Faker::Name.name }
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
metal_archives-2.2.0 spec/factories/artist_factory.rb
metal_archives-2.1.1 spec/factories/artist_factory.rb
metal_archives-2.1.0 spec/factories/artist_factory.rb
metal_archives-2.0.2 spec/factories/artist_factory.rb
metal_archives-2.0.1 spec/factories/artist_factory.rb
metal_archives-2.0.0 spec/factories/artist_factory.rb
metal_archives-1.0.0 spec/factories/artist_factory.rb