summaryrefslogtreecommitdiff
path: root/spec/factories/clusters/applications/helm.rb
blob: fd956097115b8c3662c749988bead7c1bcbbefe2 (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
36
37
38
39
40
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

    trait :timeouted do
      installing
      updated_at ClusterWaitForAppInstallationWorker::TIMEOUT.ago
    end
  end
end