Commit fc4f3164 authored by Matija Čupić's avatar Matija Čupić

Remove trailing whitespace from Clusters spec

parent 83648f24
...@@ -25,48 +25,48 @@ feature 'Clusters', :js do ...@@ -25,48 +25,48 @@ feature 'Clusters', :js do
context 'when user has a cluster and visits cluster index page' do context 'when user has a cluster and visits cluster index page' do
let!(:cluster) { create(:cluster, :project, :provided_by_gcp) } let!(:cluster) { create(:cluster, :project, :provided_by_gcp) }
let(:project) { cluster.project } let(:project) { cluster.project }
before do before do
visit project_clusters_path(project) visit project_clusters_path(project)
end end
it 'user sees a table with one cluster' do it 'user sees a table with one cluster' do
# One is the header row, the other the cluster row # One is the header row, the other the cluster row
expect(page).to have_selector('.gl-responsive-table-row', count: 2) expect(page).to have_selector('.gl-responsive-table-row', count: 2)
end end
it 'user sees a disabled add cluster button ' do it 'user sees a disabled add cluster button ' do
expect(page).to have_selector('.js-add-cluster.disabled') expect(page).to have_selector('.js-add-cluster.disabled')
end end
it 'user sees navigation tabs' do it 'user sees navigation tabs' do
expect(page.find('.js-active-tab').text).to include('Active') expect(page.find('.js-active-tab').text).to include('Active')
expect(page.find('.js-active-tab .badge').text).to include('1') expect(page.find('.js-active-tab .badge').text).to include('1')
expect(page.find('.js-inactive-tab').text).to include('Inactive') expect(page.find('.js-inactive-tab').text).to include('Inactive')
expect(page.find('.js-inactive-tab .badge').text).to include('0') expect(page.find('.js-inactive-tab .badge').text).to include('0')
expect(page.find('.js-all-tab').text).to include('All') expect(page.find('.js-all-tab').text).to include('All')
expect(page.find('.js-all-tab .badge').text).to include('1') expect(page.find('.js-all-tab .badge').text).to include('1')
end end
context 'inline update of cluster' do context 'inline update of cluster' do
it 'user can update cluster' do it 'user can update cluster' do
expect(page).to have_selector('.js-toggle-cluster-list') expect(page).to have_selector('.js-toggle-cluster-list')
end end
context 'with sucessfull request' do context 'with sucessfull request' do
it 'user sees updated cluster' do it 'user sees updated cluster' do
expect do expect do
page.find('.js-toggle-cluster-list').click page.find('.js-toggle-cluster-list').click
wait_for_requests wait_for_requests
end.to change { cluster.reload.enabled } end.to change { cluster.reload.enabled }
expect(page).not_to have_selector('.is-checked') expect(page).not_to have_selector('.is-checked')
expect(cluster.reload).not_to be_enabled expect(cluster.reload).not_to be_enabled
end end
end end
context 'with failed request' do context 'with failed request' do
it 'user sees not update cluster and error message' do it 'user sees not update cluster and error message' do
expect_any_instance_of(Clusters::UpdateService).to receive(:execute).and_call_original expect_any_instance_of(Clusters::UpdateService).to receive(:execute).and_call_original
...@@ -80,16 +80,16 @@ feature 'Clusters', :js do ...@@ -80,16 +80,16 @@ feature 'Clusters', :js do
end end
end end
end end
context 'when user clicks on a cluster' do context 'when user clicks on a cluster' do
before do before do
click_link cluster.name click_link cluster.name
end end
it 'user sees a cluster details page' do it 'user sees a cluster details page' do
expect(page).to have_button('Save') expect(page).to have_button('Save')
expect(page.find(:css, '.cluster-name').value).to eq(cluster.name) expect(page.find(:css, '.cluster-name').value).to eq(cluster.name)
end end
end end
end end
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