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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
fa8c9dff
Commit
fa8c9dff
authored
Apr 28, 2021
by
a_luna
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update spec to avoid duplication
parent
d1a6fa5f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
21 deletions
+5
-21
spec/services/merge_requests/update_service_spec.rb
spec/services/merge_requests/update_service_spec.rb
+5
-21
No files found.
spec/services/merge_requests/update_service_spec.rb
View file @
fa8c9dff
...
...
@@ -1053,19 +1053,15 @@ RSpec.describe MergeRequests::UpdateService, :mailer do
end
context
'when adding time spent'
do
let
(
:spend_time
)
{
{
duration:
1800
,
user_id:
user3
.
id
}
}
context
':use_specialized_service'
do
context
'when true'
do
it
'passes the update action to ::MergeRequests::AddSpentTimeService'
do
expect
(
::
MergeRequests
::
AddSpentTimeService
)
.
to
receive
(
:new
).
and_call_original
update_merge_request
({
spend_time:
{
duration:
1800
,
# 30min
user_id:
user3
.
id
},
use_specialized_service:
true
})
update_merge_request
(
spend_time:
spend_time
,
use_specialized_service:
true
)
end
end
...
...
@@ -1075,23 +1071,11 @@ RSpec.describe MergeRequests::UpdateService, :mailer do
end
it
'does not pass the update action to ::MergeRequests::UpdateAssigneesService when false'
do
update_merge_request
({
spend_time:
{
duration:
1800
,
# 30min
user_id:
user3
.
id
},
use_specialized_service:
false
})
update_merge_request
(
spend_time:
spend_time
,
use_specialized_service:
false
)
end
it
'does not pass the update action to ::MergeRequests::UpdateAssigneesService when nil'
do
update_merge_request
({
spend_time:
{
duration:
1800
,
# 30min
user_id:
user3
.
id
},
use_specialized_service:
nil
})
update_merge_request
(
spend_time:
spend_time
,
use_specialized_service:
nil
)
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