diff options
Diffstat (limited to 'spec/controllers/projects/labels_controller_spec.rb')
-rw-r--r-- | spec/controllers/projects/labels_controller_spec.rb | 44 |
1 files changed, 5 insertions, 39 deletions
diff --git a/spec/controllers/projects/labels_controller_spec.rb b/spec/controllers/projects/labels_controller_spec.rb index 8a3c55033cb..f452c22a5ca 100644 --- a/spec/controllers/projects/labels_controller_spec.rb +++ b/spec/controllers/projects/labels_controller_spec.rb @@ -84,46 +84,12 @@ RSpec.describe Projects::LabelsController do create(:label_priority, project: project, label: subgroup_label_2, priority: 1) end - RSpec.shared_examples 'returns ancestor group labels' do - it 'returns ancestor group labels', :aggregate_failures do - get :index, params: params + it 'returns ancestor group labels', :aggregate_failures do + params = { namespace_id: project.namespace.to_param, project_id: project } + get :index, params: params - expect(assigns(:labels)).to match_array([subgroup_label_1] + group_labels + project_labels) - expect(assigns(:prioritized_labels)).to match_array([subgroup_label_2] + group_priority_labels + project_priority_labels) - end - end - - context 'when show_inherited_labels disabled' do - before do - stub_feature_flags(show_inherited_labels: false) - end - - context 'when include_ancestor_groups false' do - let(:params) { { namespace_id: project.namespace.to_param, project_id: project } } - - it 'does not return ancestor group labels', :aggregate_failures do - get :index, params: params - - expect(assigns(:labels)).to match_array([subgroup_label_1] + project_labels) - expect(assigns(:prioritized_labels)).to match_array([subgroup_label_2] + project_priority_labels) - end - end - - context 'when include_ancestor_groups true' do - let(:params) { { namespace_id: project.namespace.to_param, project_id: project, include_ancestor_groups: true } } - - it_behaves_like 'returns ancestor group labels' - end - end - - context 'when show_inherited_labels enabled' do - let(:params) { { namespace_id: project.namespace.to_param, project_id: project } } - - before do - stub_feature_flags(show_inherited_labels: true) - end - - it_behaves_like 'returns ancestor group labels' + expect(assigns(:labels)).to match_array([subgroup_label_1] + group_labels + project_labels) + expect(assigns(:prioritized_labels)).to match_array([subgroup_label_2] + group_priority_labels + project_priority_labels) end end |