OSDN Git Service

Add Feature for milestone issue filter
authorRobert Speicher <rspeicher@gmail.com>
Wed, 10 Oct 2012 17:06:54 +0000 (13:06 -0400)
committerRobert Speicher <rspeicher@gmail.com>
Wed, 10 Oct 2012 17:08:36 +0000 (13:08 -0400)
Closes #1167

features/project/issues/milestones.feature
features/steps/project/project_milestones.rb

index a57f67d..50c090c 100644 (file)
@@ -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
index 83ed685..4d689c9 100644 (file)
@@ -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