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
8bf88876
Commit
8bf88876
authored
Apr 03, 2019
by
Alexandru Croitor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Extract confidential quick action spec to a shared example
parent
c60d0efe
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
36 deletions
+34
-36
spec/features/issues/user_uses_quick_actions_spec.rb
spec/features/issues/user_uses_quick_actions_spec.rb
+3
-36
spec/support/shared_examples/quick_actions/issue/confidential_quick_action_shared_examples.rb
...ctions/issue/confidential_quick_action_shared_examples.rb
+31
-0
No files found.
spec/features/issues/user_uses_quick_actions_spec.rb
View file @
8bf88876
...
...
@@ -43,6 +43,7 @@ describe 'Issues > User uses quick actions', :js do
describe
'issue-only commands'
do
let
(
:user
)
{
create
(
:user
)
}
let
(
:project
)
{
create
(
:project
,
:public
)
}
let
(
:issue
)
{
create
(
:issue
,
project:
project
)
}
before
do
project
.
add_maintainer
(
user
)
...
...
@@ -55,6 +56,8 @@ describe 'Issues > User uses quick actions', :js do
wait_for_requests
end
it_behaves_like
'confidential quick action'
describe
'adding a due date from note'
do
let
(
:issue
)
{
create
(
:issue
,
project:
project
)
}
...
...
@@ -137,42 +140,6 @@ describe 'Issues > User uses quick actions', :js do
end
end
describe
'make issue confidential'
do
let
(
:issue
)
{
create
(
:issue
,
project:
project
)
}
let
(
:original_issue
)
{
create
(
:issue
,
project:
project
)
}
context
'when the current user can update issues'
do
it
'does not create a note, and marks the issue as confidential'
do
add_note
(
"/confidential"
)
expect
(
page
).
not_to
have_content
"/confidential"
expect
(
page
).
to
have_content
'Commands applied'
expect
(
page
).
to
have_content
"made the issue confidential"
expect
(
issue
.
reload
).
to
be_confidential
end
end
context
'when the current user cannot update the issue'
do
let
(
:guest
)
{
create
(
:user
)
}
before
do
project
.
add_guest
(
guest
)
gitlab_sign_out
sign_in
(
guest
)
visit
project_issue_path
(
project
,
issue
)
end
it
'does not create a note, and does not mark the issue as confidential'
do
add_note
(
"/confidential"
)
expect
(
page
).
not_to
have_content
'Commands applied'
expect
(
page
).
not_to
have_content
"made the issue confidential"
expect
(
issue
.
reload
).
not_to
be_confidential
end
end
end
describe
'move the issue to another project'
do
let
(
:issue
)
{
create
(
:issue
,
project:
project
)
}
...
...
spec/support/shared_examples/quick_actions/issue/confidential_quick_action_shared_examples.rb
View file @
8bf88876
# frozen_string_literal: true
shared_examples
'confidential quick action'
do
context
'when the current user can update issues'
do
it
'does not create a note, and marks the issue as confidential'
do
add_note
(
'/confidential'
)
expect
(
page
).
not_to
have_content
'/confidential'
expect
(
page
).
to
have_content
'Commands applied'
expect
(
page
).
to
have_content
'made the issue confidential'
expect
(
issue
.
reload
).
to
be_confidential
end
end
context
'when the current user cannot update the issue'
do
let
(
:guest
)
{
create
(
:user
)
}
before
do
project
.
add_guest
(
guest
)
gitlab_sign_out
sign_in
(
guest
)
visit
project_issue_path
(
project
,
issue
)
end
it
'does not create a note, and does not mark the issue as confidential'
do
add_note
(
'/confidential'
)
expect
(
page
).
not_to
have_content
'Commands applied'
expect
(
page
).
not_to
have_content
'made the issue confidential'
expect
(
issue
.
reload
).
not_to
be_confidential
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