Commit 61fbacea authored by Coung Ngo's avatar Coung Ngo

Improve ee/spec/features/groups/iterations/iterations_list_spec.rb test

Improve test as a result of reviewer comments
parent dfea6ebb
......@@ -23,25 +23,31 @@ RSpec.describe 'Iterations list', :js do
end
it 'shows iterations on each tab' do
aggregate_failures do
expect(page).to have_link(started_iteration.title)
expect(page).to have_link(upcoming_iteration.title)
expect(page).not_to have_link(closed_iteration.title)
expect(page).not_to have_link(subgroup_iteration.title)
end
click_link('Closed')
aggregate_failures do
expect(page).to have_link(closed_iteration.title)
expect(page).not_to have_link(started_iteration.title)
expect(page).not_to have_link(upcoming_iteration.title)
expect(page).not_to have_link(subgroup_iteration.title)
end
click_link('All')
aggregate_failures do
expect(page).to have_link(started_iteration.title)
expect(page).to have_link(upcoming_iteration.title)
expect(page).to have_link(closed_iteration.title)
expect(page).not_to have_link(subgroup_iteration.title)
end
end
context 'when an iteration is clicked' do
it 'redirects to an iteration report within the group context' do
......@@ -60,20 +66,25 @@ RSpec.describe 'Iterations list', :js do
end
it 'shows iterations on each tab including ancestor iterations' do
aggregate_failures do
expect(page).to have_link(started_iteration.title)
expect(page).to have_link(upcoming_iteration.title)
expect(page).not_to have_link(closed_iteration.title)
expect(page).to have_link(subgroup_iteration.title)
end
click_link('Closed')
aggregate_failures do
expect(page).to have_link(closed_iteration.title)
expect(page).not_to have_link(started_iteration.title)
expect(page).not_to have_link(upcoming_iteration.title)
expect(page).not_to have_link(subgroup_iteration.title)
end
click_link('All')
aggregate_failures do
expect(page).to have_link(started_iteration.title)
expect(page).to have_link(upcoming_iteration.title)
expect(page).to have_link(closed_iteration.title)
......@@ -81,6 +92,7 @@ RSpec.describe 'Iterations list', :js do
end
end
end
end
context 'as user' do
before 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