2012-09-10 14:34:01 +02:00
|
|
|
class ProjectMilestones < Spinach::FeatureSteps
|
2012-09-10 17:35:03 +02:00
|
|
|
include SharedAuthentication
|
|
|
|
include SharedProject
|
|
|
|
include SharedPaths
|
|
|
|
|
2012-09-10 14:34:01 +02:00
|
|
|
Then 'I should see milestone "v2.2"' do
|
|
|
|
milestone = @project.milestones.find_by_title("v2.2")
|
|
|
|
page.should have_content(milestone.title[0..10])
|
|
|
|
page.should have_content(milestone.expires_at)
|
|
|
|
page.should have_content("Browse Issues")
|
|
|
|
end
|
|
|
|
|
|
|
|
Given 'I click link "v2.2"' do
|
|
|
|
click_link "v2.2"
|
|
|
|
end
|
|
|
|
|
|
|
|
Given 'I click link "New Milestone"' do
|
|
|
|
click_link "New Milestone"
|
|
|
|
end
|
|
|
|
|
|
|
|
And 'I submit new milestone "v2.3"' do
|
|
|
|
fill_in "milestone_title", :with => "v2.3"
|
|
|
|
click_button "Create milestone"
|
|
|
|
end
|
|
|
|
|
|
|
|
Then 'I should see milestone "v2.3"' do
|
|
|
|
milestone = @project.milestones.find_by_title("v2.3")
|
|
|
|
page.should have_content(milestone.title[0..10])
|
|
|
|
page.should have_content(milestone.expires_at)
|
|
|
|
page.should have_content("Browse Issues")
|
|
|
|
end
|
|
|
|
|
|
|
|
And 'project "Shop" has milestone "v2.2"' do
|
|
|
|
project = Project.find_by_name("Shop")
|
2012-11-06 04:31:55 +01:00
|
|
|
milestone = create(:milestone, :title => "v2.2", :project => project)
|
2012-09-10 14:34:01 +02:00
|
|
|
|
2012-11-06 04:31:55 +01:00
|
|
|
3.times { create(:issue, :project => project, :milestone => milestone) }
|
2012-09-10 14:34:01 +02:00
|
|
|
end
|
2012-10-10 19:06:54 +02:00
|
|
|
|
|
|
|
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
|
2012-09-10 14:34:01 +02:00
|
|
|
end
|