diff --git a/features/project/issues/milestones.feature b/features/project/issues/milestones.feature index a57f67d6..50c090cc 100644 --- a/features/project/issues/milestones.feature +++ b/features/project/issues/milestones.feature @@ -16,3 +16,11 @@ Feature: Project Milestones Given I click link "New Milestone" And I submit new milestone "v2.3" Then I should see milestone "v2.3" + + @javascript + Scenario: Listing closed issues + Given the milestone has open and closed issues + And I click link "v2.2" + Then I should see 3 issues + When I click link "All Issues" + Then I should see 4 issues diff --git a/features/steps/project/project_milestones.rb b/features/steps/project/project_milestones.rb index 83ed6859..4d689c95 100644 --- a/features/steps/project/project_milestones.rb +++ b/features/steps/project/project_milestones.rb @@ -36,4 +36,26 @@ class ProjectMilestones < Spinach::FeatureSteps 3.times { Factory :issue, :project => project, :milestone => milestone } end + + Given 'the milestone has open and closed issues' do + project = Project.find_by_name("Shop") + milestone = project.milestones.find_by_title('v2.2') + + # 3 Open issues created above; create one closed issue + create(:closed_issue, project: project, milestone: milestone) + end + + When 'I click link "All Issues"' do + click_link 'All Issues' + end + + Then "I should see 3 issues" do + page.should have_selector('.milestone-issue-filter tbody tr', count: 4) + page.should have_selector('.milestone-issue-filter tbody tr.hide', count: 1) + end + + Then "I should see 4 issues" do + page.should have_selector('.milestone-issue-filter tbody tr', count: 4) + page.should_not have_selector('.milestone-issue-filter tbody tr.hide') + end end