2017-12-13 19:13:44 -05:00
|
|
|
FactoryBot.define do
|
2017-11-06 09:06:10 -05:00
|
|
|
factory :cluster_provider_gcp, class: Clusters::Providers::Gcp do
|
2017-10-29 14:48:45 -04:00
|
|
|
cluster
|
|
|
|
gcp_project_id 'test-gcp-project'
|
|
|
|
|
2017-10-30 08:55:18 -04:00
|
|
|
trait :scheduled do
|
|
|
|
access_token 'access_token_123'
|
|
|
|
end
|
|
|
|
|
2017-10-29 14:48:45 -04:00
|
|
|
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
|