Sha256: baa76c21cb61a723939d8ad71a7be74eb7094f3fc3376bdbdbb1c3b6de277bdc
Contents?: true
Size: 1.39 KB
Versions: 1
Compression:
Stored size: 1.39 KB
Contents
require_relative '../lib/data_faker' FactoryGirl.define do factory :pet do name { fake_string } kind { animal_types.sample } birth_year { (1914..2014).to_a.sample } trait :bird do kind 'Bird' end factory :pet_bird, traits: [:bird] end factory :agency do name { fake_string } end factory :address do street { fake_string + %w(Street Avenue Lane Road).sample } city { fake_word.capitalize } state { fake_word.capitalize } end factory :pet_food do name { "#{animal_types.sample} #{%w(Kibble Chow Food Munchies).sample}" } end factory :pet_profile do description { "#{fake_string} #{fake_string} #{fake_string}" } end factory :pet_sitter do name { fake_string } kind { Kind.all.sample } end factory :pet_sitting_patronage do end factory :tag do registered_name { fake_string } end factory :toy do name { "#{%w(Fluffy Rubber Squeeky).sample} #{%w(Ball Stick Shoe Book).sample}" } trait :hooman do kind 'Robot Vacuum' # you know the one end trait :bell do kind 'Bell' end factory :hooman_toy, traits: [:hooman] factory :bell_toy, traits: [:bell] end factory :kind do name { fake_word } end factory :picture do end factory :album do name { fake_word } end factory :product do end end def animal_types %w(Cat Dog Ferret Moose Octopus) end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
data_works-0.1.1 | spec/factories/factories.rb |