diff options
Diffstat (limited to 'spec/lib/gitlab/pagination/cursor_based_keyset_spec.rb')
-rw-r--r-- | spec/lib/gitlab/pagination/cursor_based_keyset_spec.rb | 102 |
1 files changed, 23 insertions, 79 deletions
diff --git a/spec/lib/gitlab/pagination/cursor_based_keyset_spec.rb b/spec/lib/gitlab/pagination/cursor_based_keyset_spec.rb index 4128f745ce7..effe767e41d 100644 --- a/spec/lib/gitlab/pagination/cursor_based_keyset_spec.rb +++ b/spec/lib/gitlab/pagination/cursor_based_keyset_spec.rb @@ -6,52 +6,24 @@ RSpec.describe Gitlab::Pagination::CursorBasedKeyset do subject { described_class } describe '.available_for_type?' do - context 'with api_keyset_pagination_multi_order FF disabled' do - before do - stub_feature_flags(api_keyset_pagination_multi_order: false) - end - - it 'returns true for Group' do - expect(subject.available_for_type?(Group.all)).to be_truthy - end - - it 'returns true for Ci::Build' do - expect(subject.available_for_type?(Ci::Build.all)).to be_truthy - end - - it 'returns true for Packages::BuildInfo' do - expect(subject.available_for_type?(Packages::BuildInfo.all)).to be_truthy - end - - it 'return false for User' do - expect(subject.available_for_type?(User.all)).to be_falsey - end + it 'returns true for Group' do + expect(subject.available_for_type?(Group.all)).to be_truthy end - context 'with api_keyset_pagination_multi_order FF enabled' do - before do - stub_feature_flags(api_keyset_pagination_multi_order: true) - end - - it 'returns true for Group' do - expect(subject.available_for_type?(Group.all)).to be_truthy - end - - it 'returns true for Ci::Build' do - expect(subject.available_for_type?(Ci::Build.all)).to be_truthy - end + it 'returns true for Ci::Build' do + expect(subject.available_for_type?(Ci::Build.all)).to be_truthy + end - it 'returns true for Packages::BuildInfo' do - expect(subject.available_for_type?(Packages::BuildInfo.all)).to be_truthy - end + it 'returns true for Packages::BuildInfo' do + expect(subject.available_for_type?(Packages::BuildInfo.all)).to be_truthy + end - it 'returns true for User' do - expect(subject.available_for_type?(User.all)).to be_truthy - end + it 'returns true for User' do + expect(subject.available_for_type?(User.all)).to be_truthy + end - it 'return false for other types of relations' do - expect(subject.available_for_type?(Issue.all)).to be_falsey - end + it 'return false for other types of relations' do + expect(subject.available_for_type?(Issue.all)).to be_falsey end end @@ -100,48 +72,20 @@ RSpec.describe Gitlab::Pagination::CursorBasedKeyset do let(:order_by) { :id } let(:sort) { :desc } - context 'with api_keyset_pagination_multi_order FF disabled' do - before do - stub_feature_flags(api_keyset_pagination_multi_order: false) - end - - it 'returns true for Ci::Build' do - expect(subject.available?(cursor_based_request_context, Ci::Build.all)).to be_truthy - end - - it 'returns true for AuditEvent' do - expect(subject.available?(cursor_based_request_context, AuditEvent.all)).to be_truthy - end - - it 'returns true for Packages::BuildInfo' do - expect(subject.available?(cursor_based_request_context, Packages::BuildInfo.all)).to be_truthy - end - - it 'returns false for User' do - expect(subject.available?(cursor_based_request_context, User.all)).to be_falsey - end + it 'returns true for Ci::Build' do + expect(subject.available?(cursor_based_request_context, Ci::Build.all)).to be_truthy end - context 'with api_keyset_pagination_multi_order FF enabled' do - before do - stub_feature_flags(api_keyset_pagination_multi_order: true) - end - - it 'returns true for Ci::Build' do - expect(subject.available?(cursor_based_request_context, Ci::Build.all)).to be_truthy - end - - it 'returns true for AuditEvent' do - expect(subject.available?(cursor_based_request_context, AuditEvent.all)).to be_truthy - end + it 'returns true for AuditEvent' do + expect(subject.available?(cursor_based_request_context, AuditEvent.all)).to be_truthy + end - it 'returns true for Packages::BuildInfo' do - expect(subject.available?(cursor_based_request_context, Packages::BuildInfo.all)).to be_truthy - end + it 'returns true for Packages::BuildInfo' do + expect(subject.available?(cursor_based_request_context, Packages::BuildInfo.all)).to be_truthy + end - it 'returns true for User' do - expect(subject.available?(cursor_based_request_context, User.all)).to be_truthy - end + it 'returns true for User' do + expect(subject.available?(cursor_based_request_context, User.all)).to be_truthy end end |