debian-mirror-gitlab/features/steps/project/issues/milestones.rb

60 lines
1.7 KiB
Ruby
Raw Normal View History

2015-04-26 12:48:37 +05:30
class Spinach::Features::ProjectIssuesMilestones < Spinach::FeatureSteps
2014-09-02 18:07:02 +05:30
include SharedAuthentication
include SharedProject
include SharedPaths
include SharedMarkdown
2015-04-26 12:48:37 +05:30
step 'I should see milestone "v2.2"' do
2014-09-02 18:07:02 +05:30
milestone = @project.milestones.find_by(title: "v2.2")
page.should have_content(milestone.title[0..10])
page.should have_content(milestone.expires_at)
2015-04-26 12:48:37 +05:30
page.should have_content("Issues")
2014-09-02 18:07:02 +05:30
end
2015-04-26 12:48:37 +05:30
step 'I click link "v2.2"' do
2014-09-02 18:07:02 +05:30
click_link "v2.2"
end
2015-04-26 12:48:37 +05:30
step 'I click link "New Milestone"' do
2014-09-02 18:07:02 +05:30
click_link "New Milestone"
end
2015-04-26 12:48:37 +05:30
step 'I submit new milestone "v2.3"' do
2014-09-02 18:07:02 +05:30
fill_in "milestone_title", with: "v2.3"
click_button "Create milestone"
end
2015-04-26 12:48:37 +05:30
step 'I should see milestone "v2.3"' do
2014-09-02 18:07:02 +05:30
milestone = @project.milestones.find_by(title: "v2.3")
page.should have_content(milestone.title[0..10])
page.should have_content(milestone.expires_at)
2015-04-26 12:48:37 +05:30
page.should have_content("Issues")
2014-09-02 18:07:02 +05:30
end
2015-04-26 12:48:37 +05:30
step 'project "Shop" has milestone "v2.2"' do
2014-09-02 18:07:02 +05:30
project = Project.find_by(name: "Shop")
milestone = create(:milestone,
title: "v2.2",
project: project,
description: "# Description header"
)
3.times { create(:issue, project: project, milestone: milestone) }
end
2015-04-26 12:48:37 +05:30
step 'the milestone has open and closed issues' do
2014-09-02 18:07:02 +05:30
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
2015-04-26 12:48:37 +05:30
step 'I should see 3 issues' do
2014-09-02 18:07:02 +05:30
page.should have_selector('#tab-issues li.issue-row', count: 4)
end
end