diff options
author | Alexis Reigel <alexis.reigel.ext@siemens.com> | 2018-08-15 16:25:17 +0300 |
---|---|---|
committer | Alexis Reigel <alexis.reigel.ext@siemens.com> | 2019-03-14 20:16:03 +0300 |
commit | a8818bab76fe89bb8ab5960c614e2b734bd2c496 (patch) | |
tree | aca57e59626ae67ab5c41a6c6c6ab44cf6577304 /spec/features/search | |
parent | a52d1dbb0f7a32964ee86977cec5236cce027a93 (diff) |
add users search results to group scoped search
Diffstat (limited to 'spec/features/search')
-rw-r--r-- | spec/features/search/user_searches_for_users_spec.rb | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/spec/features/search/user_searches_for_users_spec.rb b/spec/features/search/user_searches_for_users_spec.rb index ba4b66c78cb..3725143291d 100644 --- a/spec/features/search/user_searches_for_users_spec.rb +++ b/spec/features/search/user_searches_for_users_spec.rb @@ -50,4 +50,34 @@ describe 'User searches for users' do expect(page).not_to have_content('@gob_2018') end end + + context 'when on the group page' do + it 'finds the user belonging to the group' do + group = create(:group) + + user1 = create(:user, username: 'gob_bluth', name: 'Gob Bluth') + create(:group_member, :developer, user: user1, group: group) + + user2 = create(:user, username: 'michael_bluth', name: 'Michael Bluth') + create(:group_member, :developer, user: user2, group: group) + + create(:user, username: 'gob_2018', name: 'George Oscar Bluth') + + sign_in(user1) + + visit group_path(group) + + fill_in 'search', with: 'gob' + click_button 'Go' + + expect(page).to have_content('Gob Bluth') + expect(page).to have_content('@gob_bluth') + + expect(page).not_to have_content('Michael Bluth') + expect(page).not_to have_content('@michael_bluth') + + expect(page).not_to have_content('George Oscar Bluth') + expect(page).not_to have_content('@gob_2018') + end + end end |