Commit bf1554f8c49d8243abadaf0078fbecf3ebdfaf93
1 parent
7d145adf
Exists in
master
and in
4 other branches
Add Feature for milestone issue filter
Closes #1167
Showing
2 changed files
with
30 additions
and
0 deletions
Show diff stats
features/project/issues/milestones.feature
| @@ -16,3 +16,11 @@ Feature: Project Milestones | @@ -16,3 +16,11 @@ Feature: Project Milestones | ||
| 16 | Given I click link "New Milestone" | 16 | Given I click link "New Milestone" |
| 17 | And I submit new milestone "v2.3" | 17 | And I submit new milestone "v2.3" |
| 18 | Then I should see milestone "v2.3" | 18 | Then I should see milestone "v2.3" |
| 19 | + | ||
| 20 | + @javascript | ||
| 21 | + Scenario: Listing closed issues | ||
| 22 | + Given the milestone has open and closed issues | ||
| 23 | + And I click link "v2.2" | ||
| 24 | + Then I should see 3 issues | ||
| 25 | + When I click link "All Issues" | ||
| 26 | + Then I should see 4 issues |
features/steps/project/project_milestones.rb
| @@ -36,4 +36,26 @@ class ProjectMilestones < Spinach::FeatureSteps | @@ -36,4 +36,26 @@ class ProjectMilestones < Spinach::FeatureSteps | ||
| 36 | 36 | ||
| 37 | 3.times { Factory :issue, :project => project, :milestone => milestone } | 37 | 3.times { Factory :issue, :project => project, :milestone => milestone } |
| 38 | end | 38 | end |
| 39 | + | ||
| 40 | + Given 'the milestone has open and closed issues' do | ||
| 41 | + project = Project.find_by_name("Shop") | ||
| 42 | + milestone = project.milestones.find_by_title('v2.2') | ||
| 43 | + | ||
| 44 | + # 3 Open issues created above; create one closed issue | ||
| 45 | + create(:closed_issue, project: project, milestone: milestone) | ||
| 46 | + end | ||
| 47 | + | ||
| 48 | + When 'I click link "All Issues"' do | ||
| 49 | + click_link 'All Issues' | ||
| 50 | + end | ||
| 51 | + | ||
| 52 | + Then "I should see 3 issues" do | ||
| 53 | + page.should have_selector('.milestone-issue-filter tbody tr', count: 4) | ||
| 54 | + page.should have_selector('.milestone-issue-filter tbody tr.hide', count: 1) | ||
| 55 | + end | ||
| 56 | + | ||
| 57 | + Then "I should see 4 issues" do | ||
| 58 | + page.should have_selector('.milestone-issue-filter tbody tr', count: 4) | ||
| 59 | + page.should_not have_selector('.milestone-issue-filter tbody tr.hide') | ||
| 60 | + end | ||
| 39 | end | 61 | end |