diff options
author | Robert Speicher <rspeicher@gmail.com> | 2021-01-20 22:34:23 +0300 |
---|---|---|
committer | Robert Speicher <rspeicher@gmail.com> | 2021-01-20 22:34:23 +0300 |
commit | 6438df3a1e0fb944485cebf07976160184697d72 (patch) | |
tree | 00b09bfd170e77ae9391b1a2f5a93ef6839f2597 /spec/controllers/groups | |
parent | 42bcd54d971da7ef2854b896a7b34f4ef8601067 (diff) |
Add latest changes from gitlab-org/gitlab@13-8-stable-eev13.8.0-rc42
Diffstat (limited to 'spec/controllers/groups')
-rw-r--r-- | spec/controllers/groups/labels_controller_spec.rb | 41 |
1 files changed, 5 insertions, 36 deletions
diff --git a/spec/controllers/groups/labels_controller_spec.rb b/spec/controllers/groups/labels_controller_spec.rb index 33041f1af9f..b2320615778 100644 --- a/spec/controllers/groups/labels_controller_spec.rb +++ b/spec/controllers/groups/labels_controller_spec.rb @@ -9,8 +9,6 @@ RSpec.describe Groups::LabelsController do before do group.add_owner(user) - # by default FFs are enabled in specs so we turn it off - stub_feature_flags(show_inherited_labels: false) sign_in(user) end @@ -34,41 +32,12 @@ RSpec.describe Groups::LabelsController do subgroup.add_owner(user) end - RSpec.shared_examples 'returns ancestor group labels' do - it 'returns ancestor group labels' do - get :index, params: params, format: :json + it 'returns ancestor group labels' do + params = { group_id: subgroup, only_group_labels: true } + get :index, params: params, format: :json - label_ids = json_response.map {|label| label['title']} - expect(label_ids).to match_array([group_label_1.title, subgroup_label_1.title]) - end - end - - context 'when include_ancestor_groups true' do - let(:params) { { group_id: subgroup, include_ancestor_groups: true, only_group_labels: true } } - - it_behaves_like 'returns ancestor group labels' - end - - context 'when include_ancestor_groups false' do - let(:params) { { group_id: subgroup, only_group_labels: true } } - - it 'does not return ancestor group labels', :aggregate_failures do - get :index, params: params, format: :json - - label_ids = json_response.map {|label| label['title']} - expect(label_ids).to match_array([subgroup_label_1.title]) - expect(label_ids).not_to include([group_label_1.title]) - end - end - - context 'when show_inherited_labels enabled' do - let(:params) { { group_id: subgroup } } - - before do - stub_feature_flags(show_inherited_labels: true) - end - - it_behaves_like 'returns ancestor group labels' + label_ids = json_response.map {|label| label['title']} + expect(label_ids).to match_array([group_label_1.title, subgroup_label_1.title]) end end |