diff options
author | Mehmet Beydogan <mehmet.beydogan@gmail.com> | 2016-03-10 16:26:56 +0200 |
---|---|---|
committer | Robert Speicher <rspeicher@gmail.com> | 2016-04-20 15:42:09 -0400 |
commit | 3afd08170da6f003b4f11ae1a3f737b14dedec40 (patch) | |
tree | 0e858cd1c275f7862743022e4c2b24bfef3b2148 /spec | |
parent | 1e596fef1c42a1dd925636c48fea01be444dc3ab (diff) | |
download | gitlab-ce-3afd08170da6f003b4f11ae1a3f737b14dedec40.tar.gz |
Add due_date:time field to Issue model
Add due_date text field to sidebar issue#show
Add ability sorting issues by due date ASC and DESC
Add ability to filtering issues by No Due Date, Any Due Date, Due to tomorrow, Due in this week options
Add handling issue due_date field for MergeRequest
Update CHANGELOG
Fix ambigous match for issues#show sidebar
Fix SCREAMING_SNAKE_CASE offenses for due date contants
Add specs for due date sorting and filtering on issues
Diffstat (limited to 'spec')
-rw-r--r-- | spec/features/issues_spec.rb | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/spec/features/issues_spec.rb b/spec/features/issues_spec.rb index 35c8f93abc1..ac54a0c2719 100644 --- a/spec/features/issues_spec.rb +++ b/spec/features/issues_spec.rb @@ -153,6 +153,69 @@ describe 'Issues', feature: true do expect(first_issue).to include('baz') end + describe 'sorting by due date' do + before :each do + foo.due_date = 1.day.from_now + foo.save + bar.due_date = 6.days.from_now + bar.save + end + + it 'sorts by recently due date' do + visit namespace_project_issues_path(project.namespace, project, sort: sort_value_due_date_soon) + expect(first_issue).to include('foo') + end + + it 'sorts by least recently due date' do + visit namespace_project_issues_path(project.namespace, project, sort: sort_value_due_date_later) + expect(first_issue).to include('bar') + end + + it 'sorts by least recently due date by excluding nil due dates' do + bar.update(due_date: nil) + visit namespace_project_issues_path(project.namespace, project, sort: sort_value_due_date_later) + expect(first_issue).to include('foo') + end + end + + describe 'filtering by due date' do + before :each do + foo.due_date = 1.day.from_now + foo.save + bar.due_date = 6.days.from_now + bar.save + end + + it 'filters by none' do + visit namespace_project_issues_path(project.namespace, project, due_date: Issue::NO_DUE_DATE[1]) + expect(page).not_to have_content("foo") + expect(page).not_to have_content("bar") + expect(page).to have_content("baz") + end + + it 'filters by any' do + visit namespace_project_issues_path(project.namespace, project, due_date: Issue::ANY_DUE_DATE[1]) + expect(page).to have_content("foo") + expect(page).to have_content("bar") + expect(page).to have_content("baz") + end + + it 'filters by due to tomorrow' do + visit namespace_project_issues_path(project.namespace, project, due_date: Date.tomorrow.to_s) + expect(page).to have_content("foo") + expect(page).not_to have_content("bar") + expect(page).not_to have_content("baz") + end + + it 'filters by due in this week' do + visit namespace_project_issues_path(project.namespace, project, due_date: 7.days.from_now.to_date.to_s) + expect(page).to have_content("foo") + expect(page).to have_content("bar") + expect(page).not_to have_content("baz") + end + + end + describe 'sorting by milestone' do before :each do foo.milestone = newer_due_milestone |