Welcome to mirror list, hosted at ThFree Co, Russian Federation.

user_filters_issues_spec.rb « issues « features « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 2941ea6ec36261c57f517c812e136ef169a5cce9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# frozen_string_literal: true

require 'spec_helper'

RSpec.describe 'User filters issues', :js do
  let_it_be(:user) { create(:user) }
  let_it_be(:project) { create(:project_empty_repo, :public) }

  before do
    %w[foobar barbaz].each do |title|
      create(:issue,
             author: user,
             assignees: [user],
             project: project,
             title: title)
    end

    @issue = Issue.find_by(title: 'foobar')
    @issue.milestone = create(:milestone, project: project)
    @issue.assignees = []
    @issue.save!
  end

  let(:issue) { @issue }

  it 'allows filtering by issues with no specified assignee' do
    visit project_issues_path(project, assignee_id: IssuableFinder::Params::FILTER_NONE.capitalize)

    expect(page).to have_content 'foobar'
    expect(page).not_to have_content 'barbaz'
  end

  it 'allows filtering by a specified assignee' do
    visit project_issues_path(project, assignee_id: user.id)

    expect(page).not_to have_content 'foobar'
    expect(page).to have_content 'barbaz'
  end
end