diff options
author | Zeger-Jan van de Weg <zegerjan@gitlab.com> | 2016-04-06 09:37:46 +0200 |
---|---|---|
committer | Zeger-Jan van de Weg <zegerjan@gitlab.com> | 2016-04-15 14:38:15 +0200 |
commit | 33f8b06c3925fbefd6eac38efc71eac8b787ebd7 (patch) | |
tree | 73556e330e0714897dc6facdcd579c8043561b99 /spec/controllers/autocomplete_controller_spec.rb | |
parent | 77a24965cafba42b596039f9058e2e11a7ebc0dd (diff) | |
parent | f76bfed9fc3e52c7b3b731dbb311b6b394d9af62 (diff) | |
download | gitlab-ce-33f8b06c3925fbefd6eac38efc71eac8b787ebd7.tar.gz |
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.rb | 11 |
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 |