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
c0b0e506
Commit
c0b0e506
authored
Sep 12, 2017
by
Vitaliy @blackst0ne Klachkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replace the project/milestone.feature spinach test with an rspec analog
parent
5d952f75
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
45 additions
and
78 deletions
+45
-78
changelogs/unreleased/replace_milestone-feature.yml
changelogs/unreleased/replace_milestone-feature.yml
+5
-0
features/project/milestone.feature
features/project/milestone.feature
+0
-16
features/steps/project/project_milestone.rb
features/steps/project/project_milestone.rb
+0
-62
spec/features/projects/milestones/user_interacts_with_labels_spec.rb
...es/projects/milestones/user_interacts_with_labels_spec.rb
+40
-0
No files found.
changelogs/unreleased/replace_milestone-feature.yml
0 → 100644
View file @
c0b0e506
---
title
:
Replace the project/milestone.feature spinach test with an rspec analog
merge_request
:
14171
author
:
Vitaliy @blackst0ne Klachkov
type
:
other
features/project/milestone.feature
deleted
100644 → 0
View file @
5d952f75
Feature
:
Project Milestone
Background
:
Given
I sign in as a user
And
I own project
"Shop"
And project "Shop" has labels
:
"bug",
"feature",
"enhancement"
And
project
"Shop"
has milestone
"v2.2"
And milestone has issue "Bugfix1" with labels
:
"bug",
"feature"
And milestone has issue "Bugfix2" with labels
:
"bug",
"enhancement"
@javascript
Scenario
:
Listing labels from labels tab
Given
I visit project
"Shop"
milestones page
And
I click link
"v2.2"
And
I click link
"Labels"
Then
I should see the list of labels
And
I should see the labels
"bug"
,
"enhancement"
and
"feature"
features/steps/project/project_milestone.rb
deleted
100644 → 0
View file @
5d952f75
class
Spinach::Features::ProjectMilestone
<
Spinach
::
FeatureSteps
include
SharedAuthentication
include
SharedProject
include
SharedPaths
include
WaitForRequests
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
wait_for_requests
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-sidebar'
)
do
page
.
find
(
:xpath
,
"//a[@href='#tab-labels']"
).
click
end
end
end
spec/features/projects/milestones/user_interacts_with_labels_spec.rb
0 → 100644
View file @
c0b0e506
require
'spec_helper'
describe
'User interacts with labels'
do
let
(
:user
)
{
create
(
:user
)
}
let
(
:project
)
{
create
(
:project
,
namespace:
user
.
namespace
)
}
let
(
:milestone
)
{
create
(
:milestone
,
project:
project
,
title:
'v2.2'
,
description:
'# Description header'
)
}
let
(
:issue1
)
{
create
(
:issue
,
project:
project
,
title:
'Bugfix1'
,
milestone:
milestone
)
}
let
(
:issue2
)
{
create
(
:issue
,
project:
project
,
title:
'Bugfix2'
,
milestone:
milestone
)
}
let
(
:label_bug
)
{
create
(
:label
,
project:
project
,
title:
'bug'
)
}
let
(
:label_feature
)
{
create
(
:label
,
project:
project
,
title:
'feature'
)
}
let
(
:label_enhancement
)
{
create
(
:label
,
project:
project
,
title:
'enhancement'
)
}
before
do
project
.
add_master
(
user
)
sign_in
(
user
)
issue1
.
labels
<<
[
label_bug
,
label_feature
]
issue2
.
labels
<<
[
label_bug
,
label_enhancement
]
visit
(
project_milestones_path
(
project
))
end
it
'shows the list of labels'
,
:js
do
click_link
(
'v2.2'
)
page
.
within
(
'.nav-sidebar'
)
do
page
.
find
(
:xpath
,
"//a[@href='#tab-labels']"
).
click
end
expect
(
page
).
to
have_selector
(
'ul.manage-labels-list'
)
wait_for_requests
page
.
within
(
'#tab-labels'
)
do
expect
(
page
).
to
have_content
(
label_bug
.
title
)
expect
(
page
).
to
have_content
(
label_enhancement
.
title
)
expect
(
page
).
to
have_content
(
label_feature
.
title
)
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