Commit db749d5d authored by Filipa Lacerda's avatar Filipa Lacerda

Adds tests for scoped tabs

parent d3ab245a
...@@ -23,6 +23,42 @@ feature 'Environments page', :feature, :js do ...@@ -23,6 +23,42 @@ feature 'Environments page', :feature, :js do
expect(page).to have_link('Available') expect(page).to have_link('Available')
expect(page).to have_link('Stopped') expect(page).to have_link('Stopped')
end 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 end
context 'without environments' do context 'without environments' do
......
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