diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-02-18 12:45:46 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-02-18 12:45:46 +0300 |
commit | a7b3560714b4d9cc4ab32dffcd1f74a284b93580 (patch) | |
tree | 7452bd5c3545c2fa67a28aa013835fb4fa071baf /spec/finders/issues_finder_spec.rb | |
parent | ee9173579ae56a3dbfe5afe9f9410c65bb327ca7 (diff) |
Add latest changes from gitlab-org/gitlab@14-8-stable-eev14.8.0-rc42
Diffstat (limited to 'spec/finders/issues_finder_spec.rb')
-rw-r--r-- | spec/finders/issues_finder_spec.rb | 30 |
1 files changed, 28 insertions, 2 deletions
diff --git a/spec/finders/issues_finder_spec.rb b/spec/finders/issues_finder_spec.rb index 31563a6326d..c22e56c3b9e 100644 --- a/spec/finders/issues_finder_spec.rb +++ b/spec/finders/issues_finder_spec.rb @@ -1018,6 +1018,8 @@ RSpec.describe IssuesFinder do end context 'filtering by due date' do + let_it_be(:issue_due_today) { create(:issue, project: project1, due_date: Date.current) } + let_it_be(:issue_due_tomorrow) { create(:issue, project: project1, due_date: 1.day.from_now) } let_it_be(:issue_overdue) { create(:issue, project: project1, due_date: 2.days.ago) } let_it_be(:issue_due_soon) { create(:issue, project: project1, due_date: 2.days.from_now) } @@ -1032,6 +1034,30 @@ RSpec.describe IssuesFinder do end end + context 'with param set to any due date' do + let(:params) { base_params.merge(due_date: Issue::AnyDueDate.name) } + + it 'returns issues with any due date' do + expect(issues).to contain_exactly(issue_due_today, issue_due_tomorrow, issue_overdue, issue_due_soon) + end + end + + context 'with param set to due today' do + let(:params) { base_params.merge(due_date: Issue::DueToday.name) } + + it 'returns issues due today' do + expect(issues).to contain_exactly(issue_due_today) + end + end + + context 'with param set to due tomorrow' do + let(:params) { base_params.merge(due_date: Issue::DueTomorrow.name) } + + it 'returns issues due today' do + expect(issues).to contain_exactly(issue_due_tomorrow) + end + end + context 'with param set to overdue' do let(:params) { base_params.merge(due_date: Issue::Overdue.name) } @@ -1043,8 +1069,8 @@ RSpec.describe IssuesFinder do context 'with param set to next month and previous two weeks' do let(:params) { base_params.merge(due_date: Issue::DueNextMonthAndPreviousTwoWeeks.name) } - it 'returns issues from the previous two weeks and next month' do - expect(issues).to contain_exactly(issue_overdue, issue_due_soon) + it 'returns issues due in the previous two weeks and next month' do + expect(issues).to contain_exactly(issue_due_today, issue_due_tomorrow, issue_overdue, issue_due_soon) end end |