diff options
author | Shinya Maeda <shinya@gitlab.com> | 2017-11-03 03:37:32 +0900 |
---|---|---|
committer | Shinya Maeda <shinya@gitlab.com> | 2017-11-03 03:37:32 +0900 |
commit | 3602c0b9874c6b93e6cf55e1cb0238951784604d (patch) | |
tree | 06c954ed572fdeba505f742ae2e878655288b54d /spec/factories | |
parent | b129f06733c7994fb81cef4d0bae6d6611647a83 (diff) | |
download | gitlab-ce-3602c0b9874c6b93e6cf55e1cb0238951784604d.tar.gz |
Fix some tests
Diffstat (limited to 'spec/factories')
-rw-r--r-- | spec/factories/clusters/cluster.rb | 18 |
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 |