summaryrefslogtreecommitdiff
path: root/spec/controllers
diff options
context:
space:
mode:
authorIgor <idrozdov@gitlab.com>2019-08-01 16:51:14 +0000
committerRobert Speicher <rspeicher@gmail.com>2019-08-01 16:51:14 +0000
commitf74b33cf6e5ee415417d9f2ee255f97ab6fcf7ad (patch)
treee05c4aaaf46e2f8d080c49f5a3575f32d962bdc8 /spec/controllers
parent5b38fced90e81241b4266bac78c8e53a432f5144 (diff)
downloadgitlab-ce-f74b33cf6e5ee415417d9f2ee255f97ab6fcf7ad.tar.gz
Add can_merge option to autocomplete response
It's used only if merge_request_iid param is provided
Diffstat (limited to 'spec/controllers')
-rw-r--r--spec/controllers/autocomplete_controller_spec.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/spec/controllers/autocomplete_controller_spec.rb b/spec/controllers/autocomplete_controller_spec.rb
index eaa5d6cd073..6cdd61e7abd 100644
--- a/spec/controllers/autocomplete_controller_spec.rb
+++ b/spec/controllers/autocomplete_controller_spec.rb
@@ -222,6 +222,20 @@ describe AutocompleteController do
expect(response_user_ids).to contain_exactly(non_member.id)
end
end
+
+ context 'merge_request_iid parameter included' do
+ before do
+ sign_in(user)
+ end
+
+ it 'includes can_merge option to users' do
+ merge_request = create(:merge_request, source_project: project)
+
+ get(:users, params: { merge_request_iid: merge_request.iid, project_id: project.id })
+
+ expect(json_response.first).to have_key('can_merge')
+ end
+ end
end
context 'GET projects' do