summaryrefslogtreecommitdiff
path: root/spec/support/shared_examples/requests/api/time_tracking_shared_examples.rb
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-08-19 09:08:42 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2021-08-19 09:08:42 +0000
commitb76ae638462ab0f673e5915986070518dd3f9ad3 (patch)
treebdab0533383b52873be0ec0eb4d3c66598ff8b91 /spec/support/shared_examples/requests/api/time_tracking_shared_examples.rb
parent434373eabe7b4be9593d18a585fb763f1e5f1a6f (diff)
downloadgitlab-ce-b76ae638462ab0f673e5915986070518dd3f9ad3.tar.gz
Add latest changes from gitlab-org/gitlab@14-2-stable-eev14.2.0-rc42
Diffstat (limited to 'spec/support/shared_examples/requests/api/time_tracking_shared_examples.rb')
-rw-r--r--spec/support/shared_examples/requests/api/time_tracking_shared_examples.rb18
1 files changed, 13 insertions, 5 deletions
diff --git a/spec/support/shared_examples/requests/api/time_tracking_shared_examples.rb b/spec/support/shared_examples/requests/api/time_tracking_shared_examples.rb
index afc902dd184..104e91add8b 100644
--- a/spec/support/shared_examples/requests/api/time_tracking_shared_examples.rb
+++ b/spec/support/shared_examples/requests/api/time_tracking_shared_examples.rb
@@ -128,17 +128,25 @@ RSpec.shared_examples 'time tracking endpoints' do |issuable_name|
if issuable_name == 'merge_request'
it 'calls update service with :use_specialized_service param' do
- expect(::MergeRequests::UpdateService).to receive(:new).with(project: project, current_user: user, params: hash_including(use_specialized_service: true))
-
- post api("/projects/#{project.id}/#{issuable_collection_name}/#{issuable.iid}/add_spent_time", user), params: { duration: '2h' }
+ expect(::MergeRequests::UpdateService).to receive(:new).with(
+ project: project,
+ current_user: user,
+ params: hash_including(
+ use_specialized_service: true,
+ spend_time: hash_including(duration: 7200, summary: 'summary')))
+
+ post api("/projects/#{project.id}/#{issuable_collection_name}/#{issuable.iid}/add_spent_time", user), params: { duration: '2h', summary: 'summary' }
end
end
if issuable_name == 'issue'
it 'calls update service without :use_specialized_service param' do
- expect(::Issues::UpdateService).to receive(:new).with(project: project, current_user: user, params: hash_not_including(use_specialized_service: true))
+ expect(::Issues::UpdateService).to receive(:new).with(
+ project: project,
+ current_user: user,
+ params: { spend_time: { duration: 3600, summary: 'summary', user_id: user.id } })
- post api("/projects/#{project.id}/#{issuable_collection_name}/#{issuable.iid}/add_spent_time", user), params: { duration: '2h' }
+ post api("/projects/#{project.id}/#{issuable_collection_name}/#{issuable.iid}/add_spent_time", user), params: { duration: '1h', summary: 'summary' }
end
end
end