Skip to content
Snippets Groups Projects
Commit db749d5d authored by Filipa Lacerda's avatar Filipa Lacerda
Browse files

Adds tests for scoped tabs

parent d3ab245a
No related branches found
No related tags found
1 merge request!10290Resolve "Expandable folders for environments"
Pipeline #
......@@ -23,6 +23,42 @@
expect(page).to have_link('Available')
expect(page).to have_link('Stopped')
end
describe 'with one available environment' do
given(:environment) { create(:environment, project: project, state: :available) }
describe 'in available tab page' do
it 'should show one environment' do
visit namespace_project_environments_path(project.namespace, project, scope: 'available')
expect(page.all('tbody > tr').length).to eq(1)
end
end
describe 'in stopped tab page' do
it 'should show no environments' do
visit namespace_project_environments_path(project.namespace, project, scope: 'stopped')
expect(page).to have_content('You don\'t have any environments right now')
end
end
end
describe 'with one stopped environment' do
given(:environment) { create(:environment, project: project, state: :stopped) }
describe 'in available tab page' do
it 'should show no environments' do
visit namespace_project_environments_path(project.namespace, project, scope: 'available')
expect(page).to have_content('You don\'t have any environments right now')
end
end
describe 'in stopped tab page' do
it 'should show one environment' do
visit namespace_project_environments_path(project.namespace, project, scope: 'stopped')
expect(page.all('tbody > tr').length).to eq(1)
end
end
end
end
context 'without environments' do
......
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