2020-03-13 15:44:24 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
require 'spec_helper'
|
|
|
|
|
2020-10-24 23:57:45 +05:30
|
|
|
RSpec.describe 'User filters issues', :js do
|
2020-03-13 15:44:24 +05:30
|
|
|
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
|
2020-04-22 19:07:51 +05:30
|
|
|
visit project_issues_path(project, assignee_id: IssuableFinder::Params::FILTER_NONE)
|
2020-03-13 15:44:24 +05:30
|
|
|
|
|
|
|
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
|