summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorKamil Trzcinski <ayufan@ayufan.eu>2017-12-03 21:36:01 +0100
committerKamil Trzcinski <ayufan@ayufan.eu>2017-12-03 21:36:01 +0100
commit34d8694f1f256eca28f3b5ce5b2fe21d95158142 (patch)
treea238a93996edcf8b5c699a8911e4e833ad41307a /spec
parent83346192ce3ad5d2e179af1931fca4744135a1ef (diff)
downloadgitlab-ce-34d8694f1f256eca28f3b5ce5b2fe21d95158142.tar.gz
Split views
Diffstat (limited to 'spec')
-rw-r--r--spec/factories/clusters/cluster.rb15
-rw-r--r--spec/features/projects/clusters/user_spec.rb9
2 files changed, 8 insertions, 16 deletions
diff --git a/spec/factories/clusters/cluster.rb b/spec/factories/clusters/cluster.rb
index c4261178f2d..81866845a20 100644
--- a/spec/factories/clusters/cluster.rb
+++ b/spec/factories/clusters/cluster.rb
@@ -13,27 +13,20 @@ FactoryGirl.define do
provider_type :user
platform_type :kubernetes
- platform_kubernetes do
- create(:cluster_platform_kubernetes, :configured)
- end
+ platform_kubernetes factory: [:cluster_platform_kubernetes, :configured]
end
trait :provided_by_gcp do
provider_type :gcp
platform_type :kubernetes
- before(:create) do |cluster, evaluator|
- cluster.platform_kubernetes = build(:cluster_platform_kubernetes, :configured)
- cluster.provider_gcp = build(:cluster_provider_gcp, :created)
- end
+ provider_gcp factory: [:cluster_provider_gcp, :created]
+ platform_kubernetes factory: [:cluster_platform_kubernetes, :configured]
end
trait :providing_by_gcp do
provider_type :gcp
-
- provider_gcp do
- create(:cluster_provider_gcp, :creating)
- end
+ provider_gcp factory: [:cluster_provider_gcp, :creating]
end
end
end
diff --git a/spec/features/projects/clusters/user_spec.rb b/spec/features/projects/clusters/user_spec.rb
index 1c0a88749bd..2e368387830 100644
--- a/spec/features/projects/clusters/user_spec.rb
+++ b/spec/features/projects/clusters/user_spec.rb
@@ -21,11 +21,10 @@ feature 'User Cluster', :js do
context 'when user filled form with valid parameters' do
before do
- fill_in 'cluster_provider_gcp_attributes_gcp_project_id', with: 'gcp-project-123'
fill_in 'cluster_platform_kubernetes_attributes_api_url', with: 'http://example.com'
fill_in 'cluster_platform_kubernetes_attributes_token', with: 'my-token'
fill_in 'cluster_name', with: 'dev-cluster'
- click_button 'Create cluster'
+ click_button 'Add cluster'
end
it 'user sees a cluster details page and creation status' do
@@ -35,7 +34,7 @@ feature 'User Cluster', :js do
context 'when user filled form with invalid parameters' do
before do
- click_button 'Create cluster'
+ click_button 'Add cluster'
end
it 'user sees a validation error' do
@@ -76,7 +75,7 @@ feature 'User Cluster', :js do
it 'user sees the successful message' do
expect(page).to have_content('Cluster was successfully updated.')
- expect(cluster.reload.cluster_name).to eq('my-dev-cluster')
+ expect(cluster.reload.name).to eq('my-dev-cluster')
end
end
@@ -89,7 +88,7 @@ feature 'User Cluster', :js do
it 'user sees creation form with the successful message' do
expect(page).to have_content('Cluster integration was successfully removed.')
- expect(page).to have_link('Create on GKE')
+ expect(page).to have_link('Add an existing cluster')
end
end
end