Sha256: 0c9301aa50d0d9897b7eaccd5ff61057e1563f87d0c9fcca051b0c7202b567d3

Contents?: true

Size: 455 Bytes

Versions: 4

Compression:

Stored size: 455 Bytes

Contents

FactoryGirl.define do

  factory :class_group, class: Gaku::ClassGroup do
    sequence(:name) { |n| "A#{n}" }

    grade 8
    homeroom '123'

    factory :invalid_class_group do
      name nil
    end

    factory :class_group_with_active_semester do
      ignore do
        semester { create(:active_semester) }
      end

      after(:create) do |class_group, evaluator|
        class_group.semesters << evaluator.semester
      end
    end
  end

end

Version data entries

4 entries across 4 versions & 2 rubygems

Version Path
gaku-0.2.1 core/lib/gaku/testing/factories/class_group_factory.rb
gaku_core-0.2.1 lib/gaku/testing/factories/class_group_factory.rb
gaku-0.2.0 core/lib/gaku/testing/factories/class_group_factory.rb
gaku_core-0.2.0 lib/gaku/testing/factories/class_group_factory.rb