summaryrefslogtreecommitdiff
path: root/features/steps/project/project_milestone.rb
diff options
context:
space:
mode:
authorAchilleas Pipinellis <axilleas@axilleas.me>2016-03-18 14:31:33 +0200
committerAchilleas Pipinellis <axilleas@axilleas.me>2016-03-18 14:31:33 +0200
commit4d3e8ceea562683a8ee3a87a45ece6c476558446 (patch)
treea83c195a72ac7e32edb4888e733792302c13505f /features/steps/project/project_milestone.rb
parent11dda8db29a4843026464c0a61f65ada20646e3b (diff)
parentdadd28e317ace1e3d3a2a02926eb352832b97f08 (diff)
downloadgitlab-ce-4d3e8ceea562683a8ee3a87a45ece6c476558446.tar.gz
Merge branch 'master' into docs_select_version_to_install
Diffstat (limited to 'features/steps/project/project_milestone.rb')
-rw-r--r--features/steps/project/project_milestone.rb59
1 files changed, 59 insertions, 0 deletions
diff --git a/features/steps/project/project_milestone.rb b/features/steps/project/project_milestone.rb
new file mode 100644
index 00000000000..2508c09e36d
--- /dev/null
+++ b/features/steps/project/project_milestone.rb
@@ -0,0 +1,59 @@
+class Spinach::Features::ProjectMilestone < Spinach::FeatureSteps
+ include SharedAuthentication
+ include SharedProject
+ include SharedPaths
+
+ step 'milestone has issue "Bugfix1" with labels: "bug", "feature"' do
+ project = Project.find_by(name: "Shop")
+ milestone = project.milestones.find_by(title: 'v2.2')
+ issue = create(:issue, title: "Bugfix1", project: project, milestone: milestone)
+ issue.labels << project.labels.find_by(title: 'bug')
+ issue.labels << project.labels.find_by(title: 'feature')
+ end
+
+ step 'milestone has issue "Bugfix2" with labels: "bug", "enhancement"' do
+ project = Project.find_by(name: "Shop")
+ milestone = project.milestones.find_by(title: 'v2.2')
+ issue = create(:issue, title: "Bugfix2", project: project, milestone: milestone)
+ issue.labels << project.labels.find_by(title: 'bug')
+ issue.labels << project.labels.find_by(title: 'enhancement')
+ end
+
+ step 'project "Shop" has milestone "v2.2"' do
+ 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
+
+ step 'I should see the list of labels' do
+ expect(page).to have_selector('ul.manage-labels-list')
+ end
+
+ step 'I should see the labels "bug", "enhancement" and "feature"' do
+ page.within('#tab-issues') do
+ expect(page).to have_content 'bug'
+ expect(page).to have_content 'enhancement'
+ expect(page).to have_content 'feature'
+ end
+ end
+
+ step 'I should see the "bug" label listed only once' do
+ page.within('#tab-labels') do
+ expect(page).to have_content('bug', count: 1)
+ end
+ end
+
+ step 'I click link "v2.2"' do
+ click_link "v2.2"
+ end
+
+ step 'I click link "Labels"' do
+ page.within('.nav-links') do
+ page.find(:xpath, "//a[@href='#tab-labels']").click
+ end
+ end
+end