aboutsummaryrefslogtreecommitdiffstats
path: root/spec/factories/referentials.rb
blob: a4155d18119170e4901cadf9fbe0df29650fbfe7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
FactoryGirl.define do
  factory :referential do
    sequence(:name) { |n| "Test #{n}" }
    sequence(:slug) { |n| "test_#{n}" }
    sequence(:prefix) { |n| "test_#{n}" }
    association :line_referential
    association :stop_area_referential
    association :organisation
    time_zone "Europe/Paris"
    ready { true }

    factory :workbench_referential do
      association :workbench
      before :create do | ref |
        ref.workbench.organisation = ref.organisation
      end
    end
  end
end