BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
6c29e1ef
Commit
6c29e1ef
authored
Apr 15, 2016
by
Alfredo Sumaran
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add tests to check if a new label is added
parent
9066ac0d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
79 additions
and
0 deletions
+79
-0
issue_sidebar_spec.rb
spec/features/issues/issue_sidebar_spec.rb
+79
-0
No files found.
spec/features/issues/issue_sidebar_spec.rb
0 → 100644
View file @
6c29e1ef
require
'rails_helper'
feature
'Issue Sidebar'
,
feature:
true
do
let
(
:project
)
{
create
(
:project
)
}
let
(
:issue
)
{
create
(
:issue
,
project:
project
)
}
let!
(
:user
)
{
create
(
:user
)}
before
do
create
(
:label
,
project:
project
,
title:
'bug'
)
login_as
(
user
)
end
context
'as a allowed user'
do
before
do
project
.
team
<<
[
user
,
:developer
]
visit_issue
(
project
,
issue
)
end
describe
'when clicking on edit labels'
,
js:
true
do
it
'dropdown has an option to create a new label'
do
find
(
'.block.labels .edit-link'
).
click
page
.
within
(
'.block.labels'
)
do
expect
(
page
).
to
have_content
'Create new'
end
end
end
context
'creating a new label'
,
js:
true
do
it
'option to crate a new label is present'
do
page
.
within
(
'.block.labels'
)
do
find
(
'.edit-link'
).
click
expect
(
page
).
to
have_content
'Create new'
end
end
it
'dropdown switches to "create label" section'
do
page
.
within
(
'.block.labels'
)
do
find
(
'.edit-link'
).
click
click_link
'Create new'
expect
(
page
).
to
have_content
'Create new label'
end
end
it
'new label is added'
do
page
.
within
(
'.block.labels'
)
do
find
(
'.edit-link'
).
click
sleep
1
click_link
'Create new'
fill_in
'new_label_name'
,
with:
'wontfix'
page
.
find
(
".suggest-colors a"
,
match: :first
).
click
click_button
'Create'
page
.
within
(
'.dropdown-page-one'
)
do
expect
(
page
).
to
have_content
'wontfix'
end
end
end
end
end
context
'as a guest'
do
before
do
project
.
team
<<
[
user
,
:guest
]
visit_issue
(
project
,
issue
)
end
it
'does not have a option to edit labels'
do
expect
(
page
).
not_to
have_selector
(
'.block.labels .edit-link'
)
end
end
def
visit_issue
(
project
,
issue
)
visit
namespace_project_issue_path
(
project
.
namespace
,
project
,
issue
)
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