gcp.rb 649 Bytes
Newer Older
1
FactoryBot.define do
2
  factory :cluster_provider_gcp, class: Clusters::Providers::Gcp do
3 4 5
    cluster
    gcp_project_id 'test-gcp-project'

6 7 8 9
    trait :scheduled do
      access_token 'access_token_123'
    end

10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
    trait :creating do
      access_token 'access_token_123'

      after(:build) do |gcp, evaluator|
        gcp.make_creating('operation-123')
      end
    end

    trait :created do
      endpoint '111.111.111.111'

      after(:build) do |gcp, evaluator|
        gcp.make_created
      end
    end

    trait :errored do
      after(:build) do |gcp, evaluator|
        gcp.make_errored('Something wrong')
      end
    end
  end
end