summaryrefslogtreecommitdiff
path: root/spec/factories/clusters/applications/helm.rb
blob: 968a6a1a00792bfc42030e052cf5c690dd34d181 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
FactoryGirl.define do
  factory :applications_helm, class: Clusters::Applications::Helm do
    trait :cluster do
      before(:create) do |app, _|
        app.cluster = create(:cluster)
      end
    end

    trait :installable do
      cluster
      status 0
    end

    trait :scheduled do
      cluster
      status 1
    end

    trait :installing do
      cluster
      status 2
    end

    trait :installed do
      cluster
      status 3
    end

    trait :errored do
      cluster
      status(-1)
      status_reason 'something went wrong'
    end
  end
end