Sha256: 727de0aee35c15f8ac56e039212e9291f9522d66032e28511d1f6d12e4f97737

Contents?: true

Size: 433 Bytes

Versions: 4

Compression:

Stored size: 433 Bytes

Contents

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

FactoryGirl.define do
  factory :tasuku_taskables_question_answer, aliases: [:question_answer], class: 'Tasuku::Taskables::Question::Answer' do
    author { User.create }

    ignore do
      options []
    end

    after :build do |answer, evaluator|
      evaluator.options.each do |option|
        answer.votes.build option: option
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

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