2019-07-25 01:24:42 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2018-02-11 02:16:35 -05:00
|
|
|
require 'spec_helper'
|
|
|
|
|
2020-11-02 01:08:53 -05:00
|
|
|
RSpec.describe 'Search group member', :js do
|
|
|
|
include Spec::Support::Helpers::Features::MembersHelpers
|
|
|
|
|
2018-02-11 02:16:35 -05:00
|
|
|
let(:user) { create :user }
|
|
|
|
let(:member) { create :user }
|
|
|
|
|
|
|
|
let!(:guest_group) do
|
|
|
|
create(:group) do |group|
|
|
|
|
group.add_guest(user)
|
|
|
|
group.add_guest(member)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
before do
|
|
|
|
sign_in(user)
|
|
|
|
visit group_group_members_path(guest_group)
|
|
|
|
end
|
|
|
|
|
|
|
|
it 'renders member users' do
|
2020-12-03 01:09:47 -05:00
|
|
|
page.within '[data-testid="members-filtered-search-bar"]' do
|
|
|
|
find_field('Filter members').click
|
|
|
|
find('input').native.send_keys(member.name)
|
|
|
|
click_button 'Search'
|
2018-02-11 02:16:35 -05:00
|
|
|
end
|
|
|
|
|
2020-11-02 01:08:53 -05:00
|
|
|
expect(members_table).to have_content(member.name)
|
|
|
|
expect(members_table).not_to have_content(user.name)
|
2018-02-11 02:16:35 -05:00
|
|
|
end
|
|
|
|
end
|