2015-11-25 10:44:39 +00:00
|
|
|
class Spinach::Features::GroupMilestones < Spinach::FeatureSteps
|
|
|
|
include SharedAuthentication
|
|
|
|
include SharedPaths
|
|
|
|
include SharedGroup
|
|
|
|
include SharedUser
|
|
|
|
|
|
|
|
step 'I click on group milestones' do
|
2016-05-03 11:04:47 +00:00
|
|
|
page.within('.layout-nav') do
|
|
|
|
click_link 'Milestones'
|
|
|
|
end
|
2015-11-25 10:44:39 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
step 'I should see group milestones index page has no milestones' do
|
|
|
|
expect(page).to have_content('No milestones to show')
|
|
|
|
end
|
|
|
|
|
|
|
|
step 'Group has projects with milestones' do
|
|
|
|
group_milestone
|
|
|
|
end
|
|
|
|
|
|
|
|
step 'I should see group milestones index page with milestones' do
|
|
|
|
expect(page).to have_content('Version 7.2')
|
|
|
|
expect(page).to have_content('GL-113')
|
|
|
|
expect(page).to have_link('3 Issues', href: issues_group_path("owned", milestone_title: "Version 7.2"))
|
|
|
|
expect(page).to have_link('0 Merge Requests', href: merge_requests_group_path("owned", milestone_title: "GL-113"))
|
|
|
|
end
|
|
|
|
|
|
|
|
step 'I click on one group milestone' do
|
2016-02-24 20:37:40 +00:00
|
|
|
milestones = Milestone.where(title: 'GL-113')
|
|
|
|
@global_milestone = GlobalMilestone.new('GL-113', milestones)
|
|
|
|
|
2015-11-25 10:44:39 +00:00
|
|
|
click_link 'GL-113'
|
|
|
|
end
|
|
|
|
|
|
|
|
step 'I should see group milestone with descriptions and expiry date' do
|
2016-01-08 01:23:13 +00:00
|
|
|
expect(page).to have_content('expires on Aug 20, 2114')
|
2015-11-25 10:44:39 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
step 'I should see group milestone with all issues and MRs assigned to that milestone' do
|
|
|
|
expect(page).to have_content('Milestone GL-113')
|
2016-02-24 20:37:40 +00:00
|
|
|
expect(page).to have_content('3 issues: 3 open and 0 closed')
|
2015-11-25 10:44:39 +00:00
|
|
|
issue = Milestone.find_by(name: 'GL-113').issues.first
|
|
|
|
expect(page).to have_link(issue.title, href: namespace_project_issue_path(issue.project.namespace, issue.project, issue))
|
|
|
|
end
|
|
|
|
|
|
|
|
step 'I fill milestone name' do
|
|
|
|
fill_in 'milestone_title', with: 'v2.9.0'
|
|
|
|
end
|
|
|
|
|
|
|
|
step 'I click new milestone button' do
|
|
|
|
click_link "New Milestone"
|
|
|
|
end
|
|
|
|
|
|
|
|
step 'I press create mileston button' do
|
|
|
|
click_button "Create Milestone"
|
|
|
|
end
|
|
|
|
|
|
|
|
step 'milestone in each project should be created' do
|
|
|
|
group = Group.find_by(name: 'Owned')
|
|
|
|
expect(page).to have_content "Milestone v2.9.0"
|
|
|
|
expect(group.projects).to be_present
|
|
|
|
|
|
|
|
group.projects.each do |project|
|
|
|
|
expect(page).to have_content project.name
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2016-02-24 20:37:40 +00:00
|
|
|
step 'I should see the "bug" label' do
|
|
|
|
page.within('#tab-issues') do
|
|
|
|
expect(page).to have_content 'bug'
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
step 'I should see the "feature" label' do
|
|
|
|
page.within('#tab-issues') do
|
|
|
|
expect(page).to have_content 'bug'
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
step 'I should see the project name in the Issue row' do
|
|
|
|
page.within('#tab-issues') do
|
|
|
|
@global_milestone.projects.each do |project|
|
|
|
|
expect(page).to have_content project.name
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
step 'I click on the "Labels" tab' do
|
2016-05-03 11:04:47 +00:00
|
|
|
page.within('.content .nav-links') do
|
2016-02-24 20:37:40 +00:00
|
|
|
page.find(:xpath, "//a[@href='#tab-labels']").click
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
step 'I should see the list of labels' do
|
|
|
|
page.within('#tab-labels') do
|
|
|
|
expect(page).to have_content 'bug'
|
|
|
|
expect(page).to have_content 'feature'
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2015-11-25 10:44:39 +00:00
|
|
|
private
|
|
|
|
|
|
|
|
def group_milestone
|
|
|
|
group = owned_group
|
|
|
|
|
|
|
|
%w(gitlabhq gitlab-ci cookbook-gitlab).each do |path|
|
2017-01-17 16:52:26 +00:00
|
|
|
project = create(:empty_project, path: path, group: group)
|
2015-11-25 10:44:39 +00:00
|
|
|
milestone = create :milestone, title: "Version 7.2", project: project
|
2016-02-24 20:37:40 +00:00
|
|
|
|
|
|
|
create(:label, project: project, title: 'bug')
|
|
|
|
create(:label, project: project, title: 'feature')
|
|
|
|
|
2015-11-25 10:44:39 +00:00
|
|
|
create :issue,
|
|
|
|
project: project,
|
|
|
|
assignee: current_user,
|
|
|
|
author: current_user,
|
|
|
|
milestone: milestone
|
|
|
|
|
2015-11-25 11:27:34 +00:00
|
|
|
milestone = create :milestone,
|
|
|
|
title: "GL-113",
|
|
|
|
project: project,
|
|
|
|
due_date: '2114-08-20',
|
|
|
|
description: 'Lorem Ipsum is simply dummy text'
|
2015-11-25 10:44:39 +00:00
|
|
|
|
2016-02-24 20:37:40 +00:00
|
|
|
issue = create :issue,
|
2015-11-25 10:44:39 +00:00
|
|
|
project: project,
|
|
|
|
assignee: current_user,
|
|
|
|
author: current_user,
|
|
|
|
milestone: milestone
|
2016-02-24 20:37:40 +00:00
|
|
|
|
|
|
|
issue.labels << project.labels.find_by(title: 'bug')
|
|
|
|
issue.labels << project.labels.find_by(title: 'feature')
|
2015-11-25 10:44:39 +00:00
|
|
|
end
|
2016-12-12 08:43:56 +00:00
|
|
|
|
|
|
|
current_user.refresh_authorized_projects
|
2015-11-25 10:44:39 +00:00
|
|
|
end
|
|
|
|
end
|