Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2022-08-03 21:11:59 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2022-08-03 21:11:59 +0300
commitb9b477a3f1e64590e087cfe2cc21c9d5bd448756 (patch)
treeb42659fe7d1f05c4965994929a91b386ff827ff0 /spec/requests
parent849c67f6da8d997d9fa54bba3526c64c7678aae6 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/requests')
-rw-r--r--spec/requests/api/graphql/mutations/work_items/update_spec.rb44
-rw-r--r--spec/requests/api/search_spec.rb9
2 files changed, 49 insertions, 4 deletions
diff --git a/spec/requests/api/graphql/mutations/work_items/update_spec.rb b/spec/requests/api/graphql/mutations/work_items/update_spec.rb
index d5e1ec25a13..909d6549fa5 100644
--- a/spec/requests/api/graphql/mutations/work_items/update_spec.rb
+++ b/spec/requests/api/graphql/mutations/work_items/update_spec.rb
@@ -427,6 +427,50 @@ RSpec.describe 'Update a work item' do
end
end
+ context 'when updating assignees' do
+ let(:fields) do
+ <<~FIELDS
+ workItem {
+ widgets {
+ type
+ ... on WorkItemWidgetAssignees {
+ assignees {
+ nodes {
+ id
+ username
+ }
+ }
+ }
+ }
+ }
+ errors
+ FIELDS
+ end
+
+ let(:input) do
+ { 'assigneesWidget' => { 'assigneeIds' => [developer.to_global_id.to_s] } }
+ end
+
+ it 'updates the work item assignee' do
+ expect do
+ post_graphql_mutation(mutation, current_user: current_user)
+ work_item.reload
+ end.to change(work_item, :assignee_ids).from([]).to([developer.id])
+
+ expect(response).to have_gitlab_http_status(:success)
+ expect(mutation_response['workItem']['widgets']).to include(
+ {
+ 'type' => 'ASSIGNEES',
+ 'assignees' => {
+ 'nodes' => [
+ { 'id' => developer.to_global_id.to_s, 'username' => developer.username }
+ ]
+ }
+ }
+ )
+ end
+ end
+
context 'when unsupported widget input is sent' do
let_it_be(:test_case) { create(:work_item_type, :default, :test_case, name: 'some_test_case_name') }
let_it_be(:work_item) { create(:work_item, work_item_type: test_case, project: project) }
diff --git a/spec/requests/api/search_spec.rb b/spec/requests/api/search_spec.rb
index 7e26e36a800..66b78829e0d 100644
--- a/spec/requests/api/search_spec.rb
+++ b/spec/requests/api/search_spec.rb
@@ -352,10 +352,11 @@ RSpec.describe API::Search do
end
it 'sets global search information for logging' do
- expect(Gitlab::Instrumentation::GlobalSearchApi).to receive(:set_global_search_information).with(
- global_search_type: 'basic',
- global_search_level: 'global',
- global_search_duration_s: a_kind_of(Numeric)
+ expect(Gitlab::Instrumentation::GlobalSearchApi).to receive(:set_information).with(
+ type: 'basic',
+ level: 'global',
+ scope: 'issues',
+ search_duration_s: a_kind_of(Numeric)
)
get api(endpoint, user), params: { scope: 'issues', search: 'john doe' }