diff options
author | Phil Hughes <me@iamphill.com> | 2016-03-23 16:56:16 +0000 |
---|---|---|
committer | Phil Hughes <me@iamphill.com> | 2016-03-29 11:57:04 +0100 |
commit | c9dea7761dc69ff38d101d06e0e636e1f3b2a0c4 (patch) | |
tree | 8b0152e117eeb25f2c9633697c2e3067bf77e2ae | |
parent | 7ff6af19cc2d0f300a184de3887e4e5163bc9a00 (diff) | |
download | gitlab-ce-c9dea7761dc69ff38d101d06e0e636e1f3b2a0c4.tar.gz |
Added tests for upcoming milestone filter
-rw-r--r-- | spec/features/issues/filter_by_milestone_spec.rb | 34 | ||||
-rw-r--r-- | spec/features/merge_requests/filter_by_milestone_spec.rb | 34 |
2 files changed, 68 insertions, 0 deletions
diff --git a/spec/features/issues/filter_by_milestone_spec.rb b/spec/features/issues/filter_by_milestone_spec.rb index d8e2ecb9feb..05e0dc45633 100644 --- a/spec/features/issues/filter_by_milestone_spec.rb +++ b/spec/features/issues/filter_by_milestone_spec.rb @@ -14,6 +14,40 @@ feature 'Issue filtering by Milestone', feature: true do expect(page).to have_css('.issue .title', count: 1) end + context 'filters by upcoming milestone', js: true do + it 'should not show issues with no expiry' do + create(:issue, project: project) + create(:issue, project: project, milestone: milestone) + + visit_issues(project) + filter_by_milestone(Milestone::Upcoming.title) + + expect(page).to have_css('.issue .title', count: 0) + end + + it 'should show issues in future' do + milestone = create(:milestone, project: project, due_date: Date.tomorrow) + create(:issue, project: project) + create(:issue, project: project, milestone: milestone) + + visit_issues(project) + filter_by_milestone(Milestone::Upcoming.title) + + expect(page).to have_css('.issue .title', count: 1) + end + + it 'should not show issues in past' do + milestone = create(:milestone, project: project, due_date: Date.yesterday) + create(:issue, project: project) + create(:issue, project: project, milestone: milestone) + + visit_issues(project) + filter_by_milestone(Milestone::Upcoming.title) + + expect(page).to have_css('.issue .title', count: 0) + end + end + scenario 'filters by a specific Milestone', js: true do create(:issue, project: project, milestone: milestone) create(:issue, project: project) diff --git a/spec/features/merge_requests/filter_by_milestone_spec.rb b/spec/features/merge_requests/filter_by_milestone_spec.rb index b76e4c74c79..ee0fa23de89 100644 --- a/spec/features/merge_requests/filter_by_milestone_spec.rb +++ b/spec/features/merge_requests/filter_by_milestone_spec.rb @@ -14,6 +14,40 @@ feature 'Merge Request filtering by Milestone', feature: true do expect(page).to have_css('.merge-request-title', count: 1) end + context 'filters by upcoming milestone', js: true do + it 'should not show issues with no expiry' do + create(:merge_request, :with_diffs, source_project: project) + create(:merge_request, :simple, source_project: project, milestone: milestone) + + visit_merge_requests(project) + filter_by_milestone(Milestone::Upcoming.title) + + expect(page).to have_css('.merge-request-title', count: 0) + end + + it 'should show issues in future' do + milestone = create(:milestone, project: project, due_date: Date.tomorrow) + create(:merge_request, :with_diffs, source_project: project) + create(:merge_request, :simple, source_project: project, milestone: milestone) + + visit_merge_requests(project) + filter_by_milestone(Milestone::Upcoming.title) + + expect(page).to have_css('.merge-request-title', count: 1) + end + + it 'should not show issues in past' do + milestone = create(:milestone, project: project, due_date: Date.yesterday) + create(:merge_request, :with_diffs, source_project: project) + create(:merge_request, :simple, source_project: project, milestone: milestone) + + visit_merge_requests(project) + filter_by_milestone(Milestone::Upcoming.title) + + expect(page).to have_css('.merge-request-title', count: 0) + end + end + scenario 'filters by a specific Milestone', js: true do create(:merge_request, :with_diffs, source_project: project, milestone: milestone) create(:merge_request, :simple, source_project: project) |