2014-10-02 12:42:54 -04:00
|
|
|
class Spinach::Features::ProjectIssuesMilestones < Spinach::FeatureSteps
|
2012-09-10 11:35:03 -04:00
|
|
|
include SharedAuthentication
|
|
|
|
include SharedProject
|
|
|
|
include SharedPaths
|
2014-02-04 02:48:33 -05:00
|
|
|
include SharedMarkdown
|
2012-09-10 11:35:03 -04:00
|
|
|
|
2014-09-21 17:40:22 -04:00
|
|
|
step 'I should see milestone "v2.2"' do
|
2014-01-19 13:55:59 -05:00
|
|
|
milestone = @project.milestones.find_by(title: "v2.2")
|
2015-06-12 00:44:13 -04:00
|
|
|
expect(page).to have_content(milestone.title[0..10])
|
|
|
|
expect(page).to have_content(milestone.expires_at)
|
|
|
|
expect(page).to have_content("Issues")
|
2012-09-10 08:34:01 -04:00
|
|
|
end
|
|
|
|
|
2014-09-21 17:40:22 -04:00
|
|
|
step 'I click link "v2.2"' do
|
2012-09-10 08:34:01 -04:00
|
|
|
click_link "v2.2"
|
|
|
|
end
|
|
|
|
|
2014-09-21 17:40:22 -04:00
|
|
|
step 'I click link "New Milestone"' do
|
2012-09-10 08:34:01 -04:00
|
|
|
click_link "New Milestone"
|
|
|
|
end
|
|
|
|
|
2014-09-21 17:40:22 -04:00
|
|
|
step 'I submit new milestone "v2.3"' do
|
2013-05-05 10:01:10 -04:00
|
|
|
fill_in "milestone_title", with: "v2.3"
|
2012-09-10 08:34:01 -04:00
|
|
|
click_button "Create milestone"
|
|
|
|
end
|
|
|
|
|
2014-09-21 17:40:22 -04:00
|
|
|
step 'I should see milestone "v2.3"' do
|
2014-01-19 13:55:59 -05:00
|
|
|
milestone = @project.milestones.find_by(title: "v2.3")
|
2015-06-12 00:44:13 -04:00
|
|
|
expect(page).to have_content(milestone.title[0..10])
|
|
|
|
expect(page).to have_content(milestone.expires_at)
|
|
|
|
expect(page).to have_content("Issues")
|
2012-09-10 08:34:01 -04:00
|
|
|
end
|
|
|
|
|
2014-09-21 17:40:22 -04:00
|
|
|
step 'project "Shop" has milestone "v2.2"' do
|
2014-01-19 13:55:59 -05:00
|
|
|
project = Project.find_by(name: "Shop")
|
2014-02-04 02:48:33 -05:00
|
|
|
milestone = create(:milestone,
|
|
|
|
title: "v2.2",
|
|
|
|
project: project,
|
|
|
|
description: "# Description header"
|
|
|
|
)
|
2013-05-05 10:01:10 -04:00
|
|
|
3.times { create(:issue, project: project, milestone: milestone) }
|
2012-09-10 08:34:01 -04:00
|
|
|
end
|
2012-10-10 13:06:54 -04:00
|
|
|
|
2014-09-21 17:40:22 -04:00
|
|
|
step 'the milestone has open and closed issues' do
|
2014-01-19 13:55:59 -05:00
|
|
|
project = Project.find_by(name: "Shop")
|
|
|
|
milestone = project.milestones.find_by(title: 'v2.2')
|
2012-10-10 13:06:54 -04:00
|
|
|
|
|
|
|
# 3 Open issues created above; create one closed issue
|
|
|
|
create(:closed_issue, project: project, milestone: milestone)
|
|
|
|
end
|
|
|
|
|
2015-08-31 00:51:34 -04:00
|
|
|
step 'I should see deleted milestone activity' do
|
|
|
|
expect(page).to have_content('opened milestone in')
|
|
|
|
expect(page).to have_content('destroyed milestone in')
|
|
|
|
end
|
|
|
|
|
2012-10-10 13:06:54 -04:00
|
|
|
When 'I click link "All Issues"' do
|
|
|
|
click_link 'All Issues'
|
|
|
|
end
|
|
|
|
|
2014-09-21 17:40:22 -04:00
|
|
|
step 'I should see 3 issues' do
|
2016-03-06 23:07:19 -05:00
|
|
|
expect(page).to have_selector('#tab-issues li.issuable-row', count: 4)
|
2012-10-10 13:06:54 -04:00
|
|
|
end
|
2015-07-14 18:20:38 -04:00
|
|
|
|
2015-08-31 00:51:34 -04:00
|
|
|
step 'I click link to remove milestone' do
|
2015-12-02 08:53:56 -05:00
|
|
|
click_link 'Delete'
|
2015-07-14 18:20:38 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
step 'I should see no milestones' do
|
|
|
|
expect(page).to have_content('No milestones to show')
|
|
|
|
end
|
2012-09-10 08:34:01 -04:00
|
|
|
end
|