Commit 0c465f4c authored by Simon Knox's avatar Simon Knox Committed by Vitaly Slobodin

Include cadences from parent groups

parent 63a9b054
...@@ -9,6 +9,7 @@ query IterationCadences( ...@@ -9,6 +9,7 @@ query IterationCadences(
) { ) {
group(fullPath: $fullPath) { group(fullPath: $fullPath) {
iterationCadences( iterationCadences(
includeAncestorGroups: true
before: $beforeCursor before: $beforeCursor
after: $afterCursor after: $afterCursor
first: $firstPageSize first: $firstPageSize
......
...@@ -5,19 +5,21 @@ require 'spec_helper' ...@@ -5,19 +5,21 @@ require 'spec_helper'
RSpec.describe 'User views iteration cadences', :js do RSpec.describe 'User views iteration cadences', :js do
let_it_be(:user) { create(:user) } let_it_be(:user) { create(:user) }
let_it_be(:group) { create(:group) } let_it_be(:group) { create(:group) }
let_it_be(:subgroup) { create(:group, parent: group) }
let_it_be(:cadence) { create(:iterations_cadence, group: group) } let_it_be(:cadence) { create(:iterations_cadence, group: group) }
let_it_be(:other_cadence) { create(:iterations_cadence, group: group) } let_it_be(:other_cadence) { create(:iterations_cadence, group: group) }
let_it_be(:subgroup_cadence) { create(:iterations_cadence, group: subgroup) }
let_it_be(:iteration_in_cadence) { create(:iteration, group: group, iterations_cadence: cadence) } let_it_be(:iteration_in_cadence) { create(:iteration, group: group, iterations_cadence: cadence) }
let_it_be(:closed_iteration_in_cadence) { create(:iteration, group: group, iterations_cadence: cadence, start_date: 2.weeks.ago, due_date: 1.week.ago) } let_it_be(:closed_iteration_in_cadence) { create(:iteration, group: group, iterations_cadence: cadence, start_date: 2.weeks.ago, due_date: 1.week.ago) }
let_it_be(:iteration_in_other_cadence) { create(:iteration, group: group, iterations_cadence: other_cadence) } let_it_be(:iteration_in_other_cadence) { create(:iteration, group: group, iterations_cadence: other_cadence) }
before do before do
stub_licensed_features(iterations: true) stub_licensed_features(iterations: true)
visit group_iteration_cadences_path(group)
end end
it 'shows iteration cadences with iterations when expanded', :aggregate_failures do it 'shows iteration cadences with iterations when expanded', :aggregate_failures do
visit group_iteration_cadences_path(group)
expect(page).to have_title('Iteration cadences') expect(page).to have_title('Iteration cadences')
expect(page).to have_content(cadence.title) expect(page).to have_content(cadence.title)
expect(page).to have_content(other_cadence.title) expect(page).to have_content(other_cadence.title)
...@@ -27,15 +29,25 @@ RSpec.describe 'User views iteration cadences', :js do ...@@ -27,15 +29,25 @@ RSpec.describe 'User views iteration cadences', :js do
click_button cadence.title click_button cadence.title
expect(page).to have_content(iteration_in_cadence.title) expect(page).to have_content(iteration_in_cadence.title)
expect(page).not_to have_content(subgroup_cadence.title)
expect(page).not_to have_content(iteration_in_other_cadence.title) expect(page).not_to have_content(iteration_in_other_cadence.title)
expect(page).not_to have_content(closed_iteration_in_cadence.title) expect(page).not_to have_content(closed_iteration_in_cadence.title)
end end
it 'only shows completed iterations on Done tab', :aggregate_failures do it 'only shows completed iterations on Done tab', :aggregate_failures do
visit group_iteration_cadences_path(group)
click_link 'Done' click_link 'Done'
click_button cadence.title click_button cadence.title
expect(page).not_to have_content(iteration_in_cadence.title) expect(page).not_to have_content(iteration_in_cadence.title)
expect(page).to have_content(closed_iteration_in_cadence.title) expect(page).to have_content(closed_iteration_in_cadence.title)
end end
it 'shows inherited cadences in subgroup', :aggregate_failures do
visit group_iteration_cadences_path(subgroup)
expect(page).to have_content(cadence.title)
expect(page).to have_content(other_cadence.title)
expect(page).to have_content(subgroup_cadence.title)
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