Commit 111a83f5 authored by Kushal Pandya's avatar Kushal Pandya

Update tests to reflect new Geo admin page UX

parent e100b16c
...@@ -30,8 +30,10 @@ describe Admin::GeoNodesController, :postgresql do ...@@ -30,8 +30,10 @@ describe Admin::GeoNodesController, :postgresql do
allow(Gitlab::Geo).to receive(:license_allows?).and_return(true) allow(Gitlab::Geo).to receive(:license_allows?).and_return(true)
end end
it 'renders creation form' do it 'does not display a flash message' do
expect(go).to render_template(partial: 'admin/geo_nodes/_form') go
expect(flash).not_to include(:alert)
end end
end end
...@@ -40,10 +42,6 @@ describe Admin::GeoNodesController, :postgresql do ...@@ -40,10 +42,6 @@ describe Admin::GeoNodesController, :postgresql do
allow(Gitlab::Geo).to receive(:license_allows?).and_return(false) allow(Gitlab::Geo).to receive(:license_allows?).and_return(false)
end end
it 'does not render the creation form' do
expect(go).not_to render_template(partial: 'admin/geo_nodes/_form')
end
it 'displays a flash message' do it 'displays a flash message' do
go go
......
...@@ -8,9 +8,10 @@ RSpec.describe 'admin Geo Nodes', type: :feature do ...@@ -8,9 +8,10 @@ RSpec.describe 'admin Geo Nodes', type: :feature do
sign_in(create(:admin)) sign_in(create(:admin))
end end
it 'show all public Geo Nodes' do it 'show all public Geo Nodes and create new node link' do
visit admin_geo_nodes_path visit admin_geo_nodes_path
expect(page).to have_link('New node', href: new_admin_geo_node_path)
page.within(find('.geo-nodes', match: :first)) do page.within(find('.geo-nodes', match: :first)) do
expect(page).to have_content(geo_node.url) expect(page).to have_content(geo_node.url)
end end
...@@ -20,7 +21,7 @@ RSpec.describe 'admin Geo Nodes', type: :feature do ...@@ -20,7 +21,7 @@ RSpec.describe 'admin Geo Nodes', type: :feature do
let(:new_ssh_key) { attributes_for(:key)[:key] } let(:new_ssh_key) { attributes_for(:key)[:key] }
before do before do
visit admin_geo_nodes_path visit new_admin_geo_node_path
end end
it 'creates a new Geo Node' do it 'creates a new Geo Node' do
...@@ -36,12 +37,10 @@ RSpec.describe 'admin Geo Nodes', type: :feature do ...@@ -36,12 +37,10 @@ RSpec.describe 'admin Geo Nodes', type: :feature do
end end
it 'returns an error message when a duplicate primary is added' do it 'returns an error message when a duplicate primary is added' do
check 'This is a primary node' create(:geo_node, :primary)
fill_in 'geo_node_url', with: 'https://test.example.com'
click_button 'Add Node'
check 'This is a primary node' check 'This is a primary node'
fill_in 'geo_node_url', with: 'https://secondary.example.com' fill_in 'geo_node_url', with: 'https://another-primary.example.com'
click_button 'Add Node' click_button 'Add Node'
expect(current_path).to eq admin_geo_nodes_path expect(current_path).to eq admin_geo_nodes_path
......
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