Skip to content
Snippets Groups Projects
Commit 23536559 authored by Kamil Trzcińśki's avatar Kamil Trzcińśki
Browse files

Yet another specs

parent 34d8694f
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -22,7 +22,7 @@
 
.cluster-applications-table#js-cluster-applications
 
%section.settings#js-cluster-details
%section.settings#js-cluster-details{ class: ('expanded' if expanded) }
.settings-header
%h4= s_('ClusterIntegration|Cluster details')
%button.btn.js-settings-toggle
Loading
Loading
Loading
Loading
@@ -151,6 +151,12 @@ describe Projects::ClustersController do
expect(cluster.enabled).to be_falsey
end
 
it "does not change cluster name" do
go
expect(cluster.name).to eq('test-cluster')
end
context 'when cluster is being created' do
let(:cluster) { create(:cluster, :providing_by_gcp, projects: [project]) }
 
Loading
Loading
Loading
Loading
@@ -94,6 +94,18 @@ feature 'Gcp Cluster', :js do
expect(page).to have_content('Cluster was successfully updated.')
end
end
context 'when user changes cluster parameters' do
before do
fill_in 'cluster_platform_kubernetes_attributes_namespace', with: 'my-namespace'
click_button 'Save changes'
end
it 'user sees the successful message' do
expect(page).to have_content('Cluster was successfully updated.')
expect(cluster.reload.platform_kubernetes.namespace).to eq('my-namespace')
end
end
 
context 'when user destroy the cluster' do
before do
Loading
Loading
Loading
Loading
@@ -52,7 +52,6 @@ feature 'User Cluster', :js do
 
it 'user sees a cluster details page' do
expect(page).to have_button('Save')
expect(page.find(:css, '.cluster-name').value).to eq(cluster.name)
end
 
context 'when user disables the cluster' do
Loading
Loading
@@ -67,15 +66,17 @@ feature 'User Cluster', :js do
end
end
 
context 'when user changes cluster name' do
context 'when user changes cluster parameters' do
before do
fill_in 'cluster_name', with: 'my-dev-cluster'
click_button 'Save'
fill_in 'cluster_platform_kubernetes_attributes_namespace', with: 'my-namespace'
click_button 'Save changes'
end
 
it 'user sees the successful message' do
expect(page).to have_content('Cluster was successfully updated.')
expect(cluster.reload.name).to eq('my-dev-cluster')
expect(cluster.reload.platform_kubernetes.namespace).to eq('my-namespace')
end
end
 
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment