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
Tatuya Kamada
gitlab-ce
Commits
23f45e84
Commit
23f45e84
authored
Nov 16, 2016
by
Douglas Barbosa Alexandre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add feature spec for labels subscription
parent
d533c0e7
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
74 additions
and
0 deletions
+74
-0
spec/features/projects/labels/subscription_spec.rb
spec/features/projects/labels/subscription_spec.rb
+74
-0
No files found.
spec/features/projects/labels/subscription_spec.rb
0 → 100644
View file @
23f45e84
require
'spec_helper'
feature
'Labels subscription'
,
feature:
true
do
let
(
:user
)
{
create
(
:user
)
}
let
(
:group
)
{
create
(
:group
)
}
let
(
:project
)
{
create
(
:empty_project
,
:public
,
namespace:
group
)
}
let!
(
:bug
)
{
create
(
:label
,
project:
project
,
title:
'bug'
)
}
let!
(
:feature
)
{
create
(
:group_label
,
group:
group
,
title:
'feature'
)
}
context
'when signed in'
do
before
do
project
.
team
<<
[
user
,
:developer
]
login_as
user
end
scenario
'users can subscribe/unsubscribe to labels'
,
js:
true
do
visit
namespace_project_labels_path
(
project
.
namespace
,
project
)
expect
(
page
).
to
have_content
(
'bug'
)
expect
(
page
).
to
have_content
(
'feature'
)
within
"#project_label_
#{
bug
.
id
}
"
do
expect
(
page
).
not_to
have_button
'Unsubscribe'
click_button
'Subscribe'
expect
(
page
).
not_to
have_button
'Subscribe'
expect
(
page
).
to
have_button
'Unsubscribe'
click_button
'Unsubscribe'
expect
(
page
).
to
have_button
'Subscribe'
expect
(
page
).
not_to
have_button
'Unsubscribe'
end
within
"#group_label_
#{
feature
.
id
}
"
do
expect
(
page
).
not_to
have_button
'Unsubscribe'
click_link_on_dropdown
(
'Group level'
)
expect
(
page
).
not_to
have_selector
(
'.dropdown-group-label'
)
expect
(
page
).
to
have_button
'Unsubscribe'
click_button
'Unsubscribe'
expect
(
page
).
to
have_selector
(
'.dropdown-group-label'
)
click_link_on_dropdown
(
'Project level'
)
expect
(
page
).
not_to
have_selector
(
'.dropdown-group-label'
)
expect
(
page
).
to
have_button
'Unsubscribe'
end
end
end
context
'when not signed in'
do
it
'users can not subscribe/unsubscribe to labels'
do
visit
namespace_project_labels_path
(
project
.
namespace
,
project
)
expect
(
page
).
to
have_content
'bug'
expect
(
page
).
to
have_content
'feature'
expect
(
page
).
not_to
have_button
(
'Subscribe'
)
expect
(
page
).
not_to
have_selector
(
'.dropdown-group-label'
)
end
end
def
click_link_on_dropdown
(
text
)
find
(
'.dropdown-group-label'
).
click
page
.
within
(
'.dropdown-group-label'
)
do
find
(
'a.js-subscribe-button'
,
text:
text
).
click
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