summaryrefslogtreecommitdiff
path: root/spec/factories
diff options
context:
space:
mode:
authorShinya Maeda <shinya@gitlab.com>2017-11-03 03:37:32 +0900
committerShinya Maeda <shinya@gitlab.com>2017-11-03 03:37:32 +0900
commit3602c0b9874c6b93e6cf55e1cb0238951784604d (patch)
tree06c954ed572fdeba505f742ae2e878655288b54d /spec/factories
parentb129f06733c7994fb81cef4d0bae6d6611647a83 (diff)
downloadgitlab-ce-3602c0b9874c6b93e6cf55e1cb0238951784604d.tar.gz
Fix some tests
Diffstat (limited to 'spec/factories')
-rw-r--r--spec/factories/clusters/cluster.rb18
1 files changed, 3 insertions, 15 deletions
diff --git a/spec/factories/clusters/cluster.rb b/spec/factories/clusters/cluster.rb
index ef09cfbf5e3..802981d47a0 100644
--- a/spec/factories/clusters/cluster.rb
+++ b/spec/factories/clusters/cluster.rb
@@ -2,8 +2,6 @@ FactoryGirl.define do
factory :cluster, class: Clusters::Cluster do
user
name 'test-cluster'
- provider_type :user
- platform_type :kubernetes
trait :project do
after(:create) do |cluster, evaluator|
@@ -24,28 +22,18 @@ FactoryGirl.define do
provider_type :gcp
platform_type :kubernetes
- platform_kubernetes do
- create(:platform_kubernetes, :configured)
- end
-
- provider_gcp do
- create(:provider_gcp, :created)
+ before(:create) do |cluster, evaluator|
+ cluster.platform_kubernetes = build(:platform_kubernetes, :configured)
+ cluster.provider_gcp = build(:provider_gcp, :created)
end
end
trait :providing_by_gcp do
provider_type :gcp
- platform_type :kubernetes
provider_gcp do
create(:provider_gcp, :creating)
end
-
- after(:create) do |cluster, evaluator|
- build(:platform_kubernetes, cluster: cluster).tap do |platform|
- platform.save!(validate: false)
- end
- end
end
end
end