diff options
author | Wei-Meng Lee <wlee@gitlab.com> | 2019-04-12 11:59:09 +0800 |
---|---|---|
committer | Wei-Meng Lee <wlee@gitlab.com> | 2019-04-12 14:58:42 +0800 |
commit | 3ef5666783b220422283e4d5acbcbbbfac1e935a (patch) | |
tree | 915afab9afebcecc7889143520763b3d1ebe0333 /spec/finders | |
parent | d25cdca68fb945db6b60cf4da60bc6ed503bea49 (diff) | |
download | gitlab-ce-3ef5666783b220422283e4d5acbcbbbfac1e935a.tar.gz |
Only show in autocomplete when author active
Diffstat (limited to 'spec/finders')
-rw-r--r-- | spec/finders/autocomplete/users_finder_spec.rb | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/spec/finders/autocomplete/users_finder_spec.rb b/spec/finders/autocomplete/users_finder_spec.rb index abd0d6b5185..bcde115b1a6 100644 --- a/spec/finders/autocomplete/users_finder_spec.rb +++ b/spec/finders/autocomplete/users_finder_spec.rb @@ -26,9 +26,17 @@ describe Autocomplete::UsersFinder do it { is_expected.to match_array([project.owner]) } context 'when author_id passed' do - let(:params) { { author_id: user2.id } } + context 'and author is active' do + let(:params) { { author_id: user1.id } } - it { is_expected.to match_array([project.owner, user2]) } + it { is_expected.to match_array([project.owner, user1]) } + end + + context 'and author is blocked' do + let(:params) { { author_id: user2.id } } + + it { is_expected.to match_array([project.owner]) } + end end end @@ -104,9 +112,9 @@ describe Autocomplete::UsersFinder do end context 'when filtered by author_id' do - let(:params) { { author_id: user2.id } } + let(:params) { { author_id: user1.id } } - it { is_expected.to match_array([user2, user1, external_user, omniauth_user, current_user]) } + it { is_expected.to match_array([user1, external_user, omniauth_user, current_user]) } end end end |