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,24 +23,30 @@ RSpec.describe 'Iterations list', :js do ...@@ -23,24 +23,30 @@ RSpec.describe 'Iterations list', :js do
end end
it 'shows iterations on each tab' do it 'shows iterations on each tab' do
expect(page).to have_link(started_iteration.title) aggregate_failures do
expect(page).to have_link(upcoming_iteration.title) expect(page).to have_link(started_iteration.title)
expect(page).not_to have_link(closed_iteration.title) expect(page).to have_link(upcoming_iteration.title)
expect(page).not_to have_link(subgroup_iteration.title) expect(page).not_to have_link(closed_iteration.title)
expect(page).not_to have_link(subgroup_iteration.title)
end
click_link('Closed') click_link('Closed')
expect(page).to have_link(closed_iteration.title) aggregate_failures do
expect(page).not_to have_link(started_iteration.title) expect(page).to have_link(closed_iteration.title)
expect(page).not_to have_link(upcoming_iteration.title) expect(page).not_to have_link(started_iteration.title)
expect(page).not_to have_link(subgroup_iteration.title) expect(page).not_to have_link(upcoming_iteration.title)
expect(page).not_to have_link(subgroup_iteration.title)
end
click_link('All') click_link('All')
expect(page).to have_link(started_iteration.title) aggregate_failures do
expect(page).to have_link(upcoming_iteration.title) expect(page).to have_link(started_iteration.title)
expect(page).to have_link(closed_iteration.title) expect(page).to have_link(upcoming_iteration.title)
expect(page).not_to have_link(subgroup_iteration.title) expect(page).to have_link(closed_iteration.title)
expect(page).not_to have_link(subgroup_iteration.title)
end
end end
context 'when an iteration is clicked' do context 'when an iteration is clicked' do
...@@ -60,24 +66,30 @@ RSpec.describe 'Iterations list', :js do ...@@ -60,24 +66,30 @@ RSpec.describe 'Iterations list', :js do
end end
it 'shows iterations on each tab including ancestor iterations' do it 'shows iterations on each tab including ancestor iterations' do
expect(page).to have_link(started_iteration.title) aggregate_failures do
expect(page).to have_link(upcoming_iteration.title) expect(page).to have_link(started_iteration.title)
expect(page).not_to have_link(closed_iteration.title) expect(page).to have_link(upcoming_iteration.title)
expect(page).to have_link(subgroup_iteration.title) expect(page).not_to have_link(closed_iteration.title)
expect(page).to have_link(subgroup_iteration.title)
end
click_link('Closed') click_link('Closed')
expect(page).to have_link(closed_iteration.title) aggregate_failures do
expect(page).not_to have_link(started_iteration.title) expect(page).to have_link(closed_iteration.title)
expect(page).not_to have_link(upcoming_iteration.title) expect(page).not_to have_link(started_iteration.title)
expect(page).not_to have_link(subgroup_iteration.title) expect(page).not_to have_link(upcoming_iteration.title)
expect(page).not_to have_link(subgroup_iteration.title)
end
click_link('All') click_link('All')
expect(page).to have_link(started_iteration.title) aggregate_failures do
expect(page).to have_link(upcoming_iteration.title) expect(page).to have_link(started_iteration.title)
expect(page).to have_link(closed_iteration.title) expect(page).to have_link(upcoming_iteration.title)
expect(page).to have_link(subgroup_iteration.title) expect(page).to have_link(closed_iteration.title)
expect(page).to have_link(subgroup_iteration.title)
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