Sha256: fd10c86fa449dac10a33a371081b3d4fb57dbf79a99550e3f98f4c2d0888b7ca

Contents?: true

Size: 934 Bytes

Versions: 16

Compression:

Stored size: 934 Bytes

Contents

# frozen_string_literal: true

FactoryBot.define do
  factory :works_cited_citation, class: WorksCited::Citation do
    citation_type { %w[book periodical electronic interview email tweet].sample }
    media { 'print' }
    record { Doodad.first }
    title { Faker::Book.title }
    container_title { Faker::Book.title }
    publisher { Faker::Book.publisher }
    city { Faker::Address.city }
    edition { nil }
    volume { nil }
    series { nil }
    year { [*1..100].sample.years.ago.year }
    url { Faker::Internet.url }
    published_at { 1.year.ago }
    accessed_at { 1.month.ago }
    pages { 'pp. 145-6' }
    transient do
      contributors_count { 0 }
    end

    after(:build) do |citation, evaluator|
      citation.works_cited_contributors << build_list(:works_cited_contributor, evaluator.contributors_count,
                                                      works_cited_citation: citation)
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
works_cited-0.1.16 spec/factories/citations.rb
works_cited-0.1.15 spec/factories/citations.rb
works_cited-0.1.14 spec/factories/citations.rb
works_cited-0.1.13 spec/factories/citations.rb
works_cited-0.1.11 spec/factories/citations.rb
works_cited-0.1.10 spec/factories/citations.rb
works_cited-0.1.9 spec/factories/citations.rb
works_cited-0.1.8 spec/factories/citations.rb
works_cited-0.1.7 spec/factories/citations.rb
works_cited-0.1.6 spec/factories/citations.rb
works_cited-0.1.5 spec/factories/citations.rb
works_cited-0.1.4 spec/factories/citations.rb
works_cited-0.1.3 spec/factories/citations.rb
works_cited-0.1.2 spec/factories/citations.rb
works_cited-0.1.1 spec/factories/citations.rb
works_cited-0.1.0 spec/factories/citations.rb