diff options
Diffstat (limited to 'spec/support/shared_examples/namespaces/traversal_scope_examples.rb')
-rw-r--r-- | spec/support/shared_examples/namespaces/traversal_scope_examples.rb | 43 |
1 files changed, 4 insertions, 39 deletions
diff --git a/spec/support/shared_examples/namespaces/traversal_scope_examples.rb b/spec/support/shared_examples/namespaces/traversal_scope_examples.rb index b308295b5fb..637068c5c8a 100644 --- a/spec/support/shared_examples/namespaces/traversal_scope_examples.rb +++ b/spec/support/shared_examples/namespaces/traversal_scope_examples.rb @@ -70,28 +70,10 @@ RSpec.shared_examples 'namespace traversal scopes' do end describe '.roots' do - context "use_traversal_ids feature flag is true" do - before do - stub_feature_flags(use_traversal_ids: true) - end - - it_behaves_like '.roots' - - it 'not make recursive queries' do - expect { described_class.where(id: [nested_group_1]).roots.load }.not_to make_queries_matching(/WITH RECURSIVE/) - end - end + it_behaves_like '.roots' - context "use_traversal_ids feature flag is false" do - before do - stub_feature_flags(use_traversal_ids: false) - end - - it_behaves_like '.roots' - - it 'makes recursive queries' do - expect { described_class.where(id: [nested_group_1]).roots.load }.to make_queries_matching(/WITH RECURSIVE/) - end + it 'not make recursive queries' do + expect { described_class.where(id: [nested_group_1]).roots.load }.not_to make_queries_matching(/WITH RECURSIVE/) end end @@ -263,7 +245,7 @@ RSpec.shared_examples 'namespace traversal scopes' do include_examples '.self_and_descendant_ids' end - shared_examples '.self_and_hierarchy' do + describe '.self_and_hierarchy' do let(:base_scope) { Group.where(id: base_groups) } subject { base_scope.self_and_hierarchy } @@ -292,21 +274,4 @@ RSpec.shared_examples 'namespace traversal scopes' do it { is_expected.to contain_exactly(group_1, nested_group_1, deep_nested_group_1) } end end - - describe '.self_and_hierarchy' do - it_behaves_like '.self_and_hierarchy' - - context "use_traversal_ids_for_self_and_hierarchy_scopes feature flag is false" do - before do - stub_feature_flags(use_traversal_ids_for_self_and_hierarchy_scopes: false) - end - - it_behaves_like '.self_and_hierarchy' - - it 'makes recursive queries' do - base_groups = Group.where(id: nested_group_1) - expect { base_groups.self_and_hierarchy.load }.to make_queries_matching(/WITH RECURSIVE/) - end - end - end end |