summaryrefslogtreecommitdiff
path: root/spec/support/shared_examples/features/issuables_user_dropdown_behaviors_shared_examples.rb
blob: c92c7f603d6eae960754b4afc04d3059ca2b89b5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
shared_examples 'issuable user dropdown behaviors' do
  include FilteredSearchHelpers

  before do
    issuable # ensure we have at least one issuable
    sign_in(user_in_dropdown)
  end

  %w[author assignee].each do |dropdown|
    describe "#{dropdown} dropdown", :js do
      it 'only includes members of the project/group' do
        visit issuables_path

        filtered_search.set("#{dropdown}:")

        expect(find("#js-dropdown-#{dropdown} .filter-dropdown")).to have_content(user_in_dropdown.name)
        expect(find("#js-dropdown-#{dropdown} .filter-dropdown")).not_to have_content(user_not_in_dropdown.name)
      end
    end
  end
end