Sha256: 37c27815246025498dd9b6eebbd9bff60a7112368cab4b25c9cb4f6330b6397a

Contents?: true

Size: 1.26 KB

Versions: 18

Compression:

Stored size: 1.26 KB

Contents

FactoryBot.define do
  factory :user do
    first_name { Faker::Name.first_name }
    last_name { Faker::Name.last_name }
    email { Faker::Internet.email }
    password { Faker::Internet.password }
    roles { { admin: false, manager: [true, false].sample, writer: [true, false].sample } }
    birthday { Faker::Date.birthday(min_age: 18, max_age: 65) }
    custom_css { ".header {\n  color: red;\n}" }
  end

  factory :team do
    name { Faker::Company.name }
    description { Faker::Lorem.paragraph(sentence_count: 4) }
  end

  factory :post do
    name { Faker::Quote.famous_last_words }
    body { Faker::Lorem.paragraphs(number: rand(4...10)).join("\n") }
    is_featured { [true, false].sample }
    published_at { Time.now - rand(10...365).days }
  end

  factory :project do
    name { Faker::Hacker.say_something_smart }
    status { [:closed, :rejected, :failed, :loading, :running, :waiting].sample }
    stage { ['Discovery', 'Ideea', 'Done', 'On hold', 'Cancelled'].sample }
    budget { Faker::Number.decimal(l_digits: 4) }
    country { Faker::Address.country_code }
    users_required { Faker::Number.between(from: 10, to: 100) }
    started_at { Time.now - rand(10...365).days }
    meta { [{ foo: 'bar', hey: 'hi' }, { bar: 'baz' }, { hoho: 'hohoho' }].sample }
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
avo-0.4.10 db/factories.rb
avo-0.4.9 db/factories.rb
avo-0.4.8 db/factories.rb
avo-0.4.7 db/factories.rb
avo-0.4.6 db/factories.rb
avo-0.4.5 db/factories.rb
avo-0.4.4 db/factories.rb
avo-0.4.3 db/factories.rb
avo-0.4.2 db/factories.rb
avo-0.4.1 db/factories.rb
avo-0.3.2 db/factories.rb
avo-0.3.1 db/factories.rb
avo-0.2.5 db/factories.rb
avo-0.2.4 db/factories.rb
avo-0.2.3 db/factories.rb
avo-0.2.2 db/factories.rb
avo-0.2.1 db/factories.rb
avo-0.2.0 db/factories.rb