Yet another specs
This commit is contained in:
parent
34d8694f1f
commit
2353655991
5 changed files with 23 additions and 4 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in a new issue