Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'spec/finders/error_tracking/errors_finder_spec.rb')
-rw-r--r--spec/finders/error_tracking/errors_finder_spec.rb15
1 files changed, 13 insertions, 2 deletions
diff --git a/spec/finders/error_tracking/errors_finder_spec.rb b/spec/finders/error_tracking/errors_finder_spec.rb
index 29053054f9d..66eb7769a4c 100644
--- a/spec/finders/error_tracking/errors_finder_spec.rb
+++ b/spec/finders/error_tracking/errors_finder_spec.rb
@@ -29,14 +29,25 @@ RSpec.describe ErrorTracking::ErrorsFinder do
context 'with sort parameter' do
let(:params) { { status: 'unresolved', sort: 'first_seen' } }
- it { is_expected.to eq([error, error_yesterday]) }
+ it { expect(subject.to_a).to eq([error, error_yesterday]) }
end
- context 'with limit parameter' do
+ context 'pagination' do
let(:params) { { limit: '1', sort: 'first_seen' } }
# Sort by first_seen is DESC by default, so the most recent error is `error`
it { is_expected.to contain_exactly(error) }
+
+ it { expect(subject.has_next_page?).to be_truthy }
+
+ it 'returns next page by cursor' do
+ params_with_cursor = params.merge(cursor: subject.cursor_for_next_page)
+ errors = described_class.new(user, project, params_with_cursor).execute
+
+ expect(errors).to contain_exactly(error_resolved)
+ expect(errors.has_next_page?).to be_truthy
+ expect(errors.has_previous_page?).to be_truthy
+ end
end
end
end