diff options
author | Mehmet Beydogan <mehmet.beydogan@gmail.com> | 2016-03-18 19:17:01 +0200 |
---|---|---|
committer | Robert Speicher <rspeicher@gmail.com> | 2016-04-20 15:42:09 -0400 |
commit | 61a306aa58f7fffd652a31b85719b19d08f0fd7f (patch) | |
tree | d937ae097121109cc05070bde406ae7dc18416aa /spec/features | |
parent | 83bda94ffcfe1944ea255fdbb8dfd9dac5b97d9f (diff) | |
download | gitlab-ce-61a306aa58f7fffd652a31b85719b19d08f0fd7f.tar.gz |
Fix functionality of due this week. Add due this month and overdue, remove due tomorrow to issues.
Fix typos on sorting dropdown related to due date
Remove constant array and add Structs on Issue to keep due date data to fill options
Diffstat (limited to 'spec/features')
-rw-r--r-- | spec/features/issues_spec.rb | 30 |
1 files changed, 23 insertions, 7 deletions
diff --git a/spec/features/issues_spec.rb b/spec/features/issues_spec.rb index ac54a0c2719..32c27d6e97e 100644 --- a/spec/features/issues_spec.rb +++ b/spec/features/issues_spec.rb @@ -187,33 +187,49 @@ describe 'Issues', feature: true do end it 'filters by none' do - visit namespace_project_issues_path(project.namespace, project, due_date: Issue::NO_DUE_DATE[1]) + visit namespace_project_issues_path(project.namespace, project, due_date: Issue::NoDueDate.name) 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]) + visit namespace_project_issues_path(project.namespace, project, due_date: Issue::AnyDueDate.name) 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) + it 'filters by due this week' do + foo.update(due_date: Date.today.beginning_of_week + 2.days) + bar.update(due_date: Date.today.end_of_week) + baz.update(due_date: Date.today - 8.days) + visit namespace_project_issues_path(project.namespace, project, due_date: Issue::DueThisWeek.name) expect(page).to have_content("foo") - expect(page).not_to have_content("bar") + expect(page).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) + it 'filters by due this month' do + foo.update(due_date: Date.today.beginning_of_month + 2.days) + bar.update(due_date: Date.today.end_of_month) + baz.update(due_date: Date.today - 50.days) + visit namespace_project_issues_path(project.namespace, project, due_date: Issue::DueThisMonth.name) expect(page).to have_content("foo") expect(page).to have_content("bar") expect(page).not_to have_content("baz") end + it 'filters by overdue' do + foo.update(due_date: Date.today + 2.days) + bar.update(due_date: Date.today + 20.days) + baz.update(due_date: Date.yesterday) + visit namespace_project_issues_path(project.namespace, project, due_date: Issue::OverDue.name) + expect(page).not_to have_content("foo") + expect(page).not_to have_content("bar") + expect(page).to have_content("baz") + end + end describe 'sorting by milestone' do |