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
08e2bc39
Commit
08e2bc39
authored
Apr 03, 2019
by
Alexandru Croitor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Extract remove due date spec to shared example
parent
1ddd9eff
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
34 deletions
+27
-34
spec/features/issues/user_uses_quick_actions_spec.rb
spec/features/issues/user_uses_quick_actions_spec.rb
+2
-19
spec/support/shared_examples/quick_actions/issue/remove_due_date_quick_action_shared_examples.rb
...ons/issue/remove_due_date_quick_action_shared_examples.rb
+25
-15
No files found.
spec/features/issues/user_uses_quick_actions_spec.rb
View file @
08e2bc39
...
...
@@ -43,7 +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
)
}
let
(
:issue
)
{
create
(
:issue
,
project:
project
,
due_date:
Date
.
new
(
2016
,
8
,
28
)
)
}
before
do
project
.
add_maintainer
(
user
)
...
...
@@ -57,6 +57,7 @@ describe 'Issues > User uses quick actions', :js do
end
it_behaves_like
'confidential quick action'
it_behaves_like
'remove_due_date quick action'
describe
'adding a due date from note'
do
let
(
:issue
)
{
create
(
:issue
,
project:
project
)
}
...
...
@@ -76,24 +77,6 @@ describe 'Issues > User uses quick actions', :js do
end
end
describe
'removing a due date from note'
do
let
(
:issue
)
{
create
(
:issue
,
project:
project
,
due_date:
Date
.
new
(
2016
,
8
,
28
))
}
it_behaves_like
'remove_due_date action available and due date can be removed'
context
'when the current user cannot update the due date'
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_behaves_like
'remove_due_date action not available'
end
end
describe
'toggling the WIP prefix from the title from note'
do
let
(
:issue
)
{
create
(
:issue
,
project:
project
)
}
...
...
spec/support/shared_examples/quick_actions/issue/remove_due_date_quick_action_shared_examples.rb
View file @
08e2bc39
# frozen_string_literal: true
shared_examples
'remove_due_date action not available'
do
it
'does not remove the due date'
do
add_note
(
"/remove_due_date"
)
shared_examples
'remove_due_date quick action'
do
context
'remove_due_date action available and due date can be removed'
do
it
'removes the due date accordingly'
do
add_note
(
'/remove_due_date'
)
expect
(
page
).
not_to
have_content
'Commands applied
'
expect
(
page
).
not_to
have_content
'/remove_due_date
'
end
end
expect
(
page
).
not_to
have_content
'/remove_due_date
'
expect
(
page
).
to
have_content
'Commands applied
'
visit
project_issue_path
(
project
,
issue
)
shared_examples
'remove_due_date action available and due date can be removed'
do
it
'removes the due date accordingly'
do
add_note
(
'/remove_due_date'
)
page
.
within
'.due_date'
do
expect
(
page
).
to
have_content
'No due date'
end
end
end
expect
(
page
).
not_to
have_content
'/remove_due_date'
expect
(
page
).
to
have_content
'Commands applied'
context
'remove_due_date action not available'
do
let
(
:guest
)
{
create
(
:user
)
}
before
do
project
.
add_guest
(
guest
)
gitlab_sign_out
sign_in
(
guest
)
visit
project_issue_path
(
project
,
issue
)
end
visit
project_issue_path
(
project
,
issue
)
it
'does not remove the due date'
do
add_note
(
"/remove_due_date"
)
page
.
within
'.due_date'
do
expect
(
page
).
to
have_content
'No due
date'
expect
(
page
).
not_to
have_content
'Commands applied'
expect
(
page
).
not_to
have_content
'/remove_due_
date'
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