Sha256: 383aef1fa930171217aaf0d43046ee1f681fd2efdcb081112bc7c4c8dbc32eac

Contents?: true

Size: 387 Bytes

Versions: 13

Compression:

Stored size: 387 Bytes

Contents

FactoryBot.define do
  factory :question_sheet, class: Fe::QuestionSheet do
    sequence(:label) { |n| "Question Sheet #{n}"}

    factory :question_sheet_with_pages do
      transient do
        pages_count { 5 }
      end

      after(:create) do |question_sheet, evaluator|
        create_list(:page, evaluator.pages_count, question_sheet: question_sheet)
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
fe-2.1.5 spec/factories/question_sheet.rb
fe-2.1.4 spec/factories/question_sheet.rb
fe-2.1.3 spec/factories/question_sheet.rb
fe-2.1.2 spec/factories/question_sheet.rb
fe-2.1.1 spec/factories/question_sheet.rb
fe-2.0.8 spec/factories/question_sheet.rb
fe-2.0.6 spec/factories/question_sheet.rb
fe-2.0.5 spec/factories/question_sheet.rb
fe-2.0.4 spec/factories/question_sheet.rb
fe-2.0.3 spec/factories/question_sheet.rb
fe-2.0.2 spec/factories/question_sheet.rb
fe-2.0.1 spec/factories/question_sheet.rb
fe-2.0.0 spec/factories/question_sheet.rb