Commit 23536559 authored by Kamil Trzcinski's avatar Kamil Trzcinski

Yet another specs

parent 34d8694f
......@@ -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
......
......@@ -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]) }
......
......@@ -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
......
......@@ -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
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment