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:
authorZeger-Jan van de Weg <zegerjan@gitlab.com>2016-04-06 10:37:46 +0300
committerZeger-Jan van de Weg <zegerjan@gitlab.com>2016-04-15 15:38:15 +0300
commit33f8b06c3925fbefd6eac38efc71eac8b787ebd7 (patch)
tree73556e330e0714897dc6facdcd579c8043561b99 /spec/controllers/autocomplete_controller_spec.rb
parent77a24965cafba42b596039f9058e2e11a7ebc0dd (diff)
parentf76bfed9fc3e52c7b3b731dbb311b6b394d9af62 (diff)
Merge branch 'master' into assign-to-issuable-opener
Diffstat (limited to 'spec/controllers/autocomplete_controller_spec.rb')
-rw-r--r--spec/controllers/autocomplete_controller_spec.rb11
1 files changed, 9 insertions, 2 deletions
diff --git a/spec/controllers/autocomplete_controller_spec.rb b/spec/controllers/autocomplete_controller_spec.rb
index f83c3b64f8f..28cf804c1b2 100644
--- a/spec/controllers/autocomplete_controller_spec.rb
+++ b/spec/controllers/autocomplete_controller_spec.rb
@@ -147,13 +147,20 @@ describe AutocompleteController do
context 'author of issuable included' do
before do
sign_in(user)
- get(:users, author_id: non_member.id)
end
let(:body) { JSON.parse(response.body) }
- it 'should also return the author' do
+ it 'includes the author' do
+ get(:users, author_id: non_member.id)
+
expect(body.first["username"]).to eq non_member.username
end
+
+ it 'rejects non existent user ids' do
+ get(:users, author_id: 99999)
+
+ expect(body.collect { |u| u['id'] }).not_to include(99999)
+ end
end
end