Add Feature for milestone issue filter

Closes #1167
This commit is contained in:
Robert Speicher 2012-10-10 13:06:54 -04:00
parent 7d145adf35
commit bf1554f8c4
2 changed files with 30 additions and 0 deletions

View 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

View 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