commit_statuses.rb 857 Bytes
Newer Older
1 2 3 4 5
FactoryGirl.define do
  factory :commit_status, class: CommitStatus do
    name 'default'
    status 'success'
    description 'commit status'
6
    pipeline factory: :ci_pipeline_with_one_job
7
    started_at 'Tue, 26 Jan 2016 08:21:42 +0100'
8 9
    finished_at 'Tue, 26 Jan 2016 08:23:42 +0100'

10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
    trait :success do
      status 'success'
    end

    trait :failed do
      status 'failed'
    end

    trait :canceled do
      status 'canceled'
    end

    trait :running do
      status 'running'
    end

    trait :pending do
      status 'pending'
    end

    trait :created do
      status 'created'
    end

34
    after(:build) do |build, evaluator|
35
      build.project = build.pipeline.project
36
    end
37 38 39 40 41 42 43

    factory :generic_commit_status, class: GenericCommitStatus do
      name 'generic'
      description 'external commit status'
    end
  end
end