Sha256: 2a4428c142f21fb675c1251853f1de88e4d9ba5ca897b5cf9485821182ac4722

Contents?: true

Size: 551 Bytes

Versions: 4

Compression:

Stored size: 551 Bytes

Contents

# Read about factories at https://github.com/thoughtbot/factory_girl

FactoryGirl.define do
  factory :tasuku_taskables_question, aliases: [:question], class: 'Tasuku::Taskables::Question' do
    text "MyText"
    multiple true

    factory :tasuku_taskables_question_with_options, aliases: [:question_with_options] do
      ignore do
        options_count 3
      end
      after :build do |question, evaluator|
        evaluator.options_count.times do |n|
          question.options.build text: "Option #{n}"
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
tasuku-1.1.0 spec/factories/tasuku_taskables_questions.rb
tasuku-1.0.1 spec/factories/tasuku_taskables_questions.rb
tasuku-0.1.1 spec/factories/tasuku_taskables_questions.rb
tasuku-0.1.0 spec/factories/tasuku_taskables_questions.rb