Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
gitlab-ce
Commits
baa782ac
Commit
baa782ac
authored
Feb 24, 2016
by
Rubén Dávila
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add some spinach specs.
parent
3f2d8248
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
71 additions
and
2 deletions
+71
-2
features/group/milestones.feature
features/group/milestones.feature
+18
-0
features/steps/group/milestones.rb
features/steps/group/milestones.rb
+53
-2
No files found.
features/group/milestones.feature
View file @
baa782ac
...
@@ -28,3 +28,21 @@ Feature: Group Milestones
...
@@ -28,3 +28,21 @@ Feature: Group Milestones
And
I fill milestone name
And
I fill milestone name
When
I press create mileston button
When
I press create mileston button
Then
milestone in each project should be created
Then
milestone in each project should be created
Scenario
:
I
should see Issues listed with labels
Given
Group has projects with milestones
When
I visit group
"Owned"
page
And
I click on group milestones
And
I click on one group milestone
Then
I should see the
"bug"
label
And
I should see the
"feature"
label
And
I should see the project name in the Issue row
Scenario
:
I
should see the Labels tab
Given
Group has projects with milestones
When
I visit group
"Owned"
page
And
I click on group milestones
And
I click on one group milestone
And
I click on the
"Labels"
tab
Then
I should see the list of labels
And
I should see the project name in the Label row
features/steps/group/milestones.rb
View file @
baa782ac
...
@@ -24,6 +24,9 @@ class Spinach::Features::GroupMilestones < Spinach::FeatureSteps
...
@@ -24,6 +24,9 @@ class Spinach::Features::GroupMilestones < Spinach::FeatureSteps
end
end
step
'I click on one group milestone'
do
step
'I click on one group milestone'
do
milestones
=
Milestone
.
where
(
title:
'GL-113'
)
@global_milestone
=
GlobalMilestone
.
new
(
'GL-113'
,
milestones
)
click_link
'GL-113'
click_link
'GL-113'
end
end
...
@@ -33,7 +36,7 @@ class Spinach::Features::GroupMilestones < Spinach::FeatureSteps
...
@@ -33,7 +36,7 @@ class Spinach::Features::GroupMilestones < Spinach::FeatureSteps
step
'I should see group milestone with all issues and MRs assigned to that milestone'
do
step
'I should see group milestone with all issues and MRs assigned to that milestone'
do
expect
(
page
).
to
have_content
(
'Milestone GL-113'
)
expect
(
page
).
to
have_content
(
'Milestone GL-113'
)
expect
(
page
).
to
have_content
(
'
Progress: 0 closed – 3 open
'
)
expect
(
page
).
to
have_content
(
'
3 issues: 3 open and 0 closed
'
)
issue
=
Milestone
.
find_by
(
name:
'GL-113'
).
issues
.
first
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
))
expect
(
page
).
to
have_link
(
issue
.
title
,
href:
namespace_project_issue_path
(
issue
.
project
.
namespace
,
issue
.
project
,
issue
))
end
end
...
@@ -60,6 +63,47 @@ class Spinach::Features::GroupMilestones < Spinach::FeatureSteps
...
@@ -60,6 +63,47 @@ class Spinach::Features::GroupMilestones < Spinach::FeatureSteps
end
end
end
end
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
page
.
within
(
'.nav-links'
)
do
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
step
'I should see the project name in the Label row'
do
page
.
within
(
'#tab-labels'
)
do
@global_milestone
.
projects
.
each
do
|
project
|
expect
(
page
).
to
have_content
project
.
name
end
end
end
private
private
def
group_milestone
def
group_milestone
...
@@ -68,6 +112,10 @@ class Spinach::Features::GroupMilestones < Spinach::FeatureSteps
...
@@ -68,6 +112,10 @@ class Spinach::Features::GroupMilestones < Spinach::FeatureSteps
%w(gitlabhq gitlab-ci cookbook-gitlab)
.
each
do
|
path
|
%w(gitlabhq gitlab-ci cookbook-gitlab)
.
each
do
|
path
|
project
=
create
:project
,
path:
path
,
group:
group
project
=
create
:project
,
path:
path
,
group:
group
milestone
=
create
:milestone
,
title:
"Version 7.2"
,
project:
project
milestone
=
create
:milestone
,
title:
"Version 7.2"
,
project:
project
create
(
:label
,
project:
project
,
title:
'bug'
)
create
(
:label
,
project:
project
,
title:
'feature'
)
create
:issue
,
create
:issue
,
project:
project
,
project:
project
,
assignee:
current_user
,
assignee:
current_user
,
...
@@ -80,11 +128,14 @@ class Spinach::Features::GroupMilestones < Spinach::FeatureSteps
...
@@ -80,11 +128,14 @@ class Spinach::Features::GroupMilestones < Spinach::FeatureSteps
due_date:
'2114-08-20'
,
due_date:
'2114-08-20'
,
description:
'Lorem Ipsum is simply dummy text'
description:
'Lorem Ipsum is simply dummy text'
create
:issue
,
issue
=
create
:issue
,
project:
project
,
project:
project
,
assignee:
current_user
,
assignee:
current_user
,
author:
current_user
,
author:
current_user
,
milestone:
milestone
milestone:
milestone
issue
.
labels
<<
project
.
labels
.
find_by
(
title:
'bug'
)
issue
.
labels
<<
project
.
labels
.
find_by
(
title:
'feature'
)
end
end
end
end
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment