Commit 00d66140 authored by Lin Jen-Shin's avatar Lin Jen-Shin

Bring changes from EE

parent 94ac31e2
......@@ -10,6 +10,7 @@ describe 'Filter issues', :js do
# When the name is longer, the filtered search input can end up scrolling
# horizontally, and PhantomJS can't handle it.
let(:user) { create(:user, name: 'Ann') }
let(:user2) { create(:user, name: 'jane') }
let!(:bug_label) { create(:label, project: project, title: 'bug') }
let!(:caps_sensitive_label) { create(:label, project: project, title: 'CaPs') }
......@@ -25,8 +26,6 @@ describe 'Filter issues', :js do
before do
project.add_master(user)
user2 = create(:user)
create(:issue, project: project, author: user2, title: "Bug report 1")
create(:issue, project: project, author: user2, title: "Bug report 2")
......@@ -113,6 +112,24 @@ describe 'Filter issues', :js do
expect_issues_list_count(3)
expect_filtered_search_input_empty
end
it 'filters issues by invalid assignee' do
skip('to be tested, issue #26546')
end
it 'filters issues by multiple assignees' do
create(:issue, project: project, author: user, assignees: [user2, user])
input_filtered_search("assignee:@#{user.username} assignee:@#{user2.username}")
expect_tokens([
assignee_token(user.name),
assignee_token(user2.name)
])
expect_issues_list_count(1)
expect_filtered_search_input_empty
end
end
end
......@@ -491,6 +508,21 @@ describe 'Filter issues', :js do
it_behaves_like 'updates atom feed link', :group do
let(:path) { issues_group_path(group, milestone_title: milestone.title, assignee_id: user.id) }
end
it 'updates atom feed link for group issues' do
visit issues_group_path(group, milestone_title: milestone.title, assignee_id: user.id)
link = find('.nav-controls a[title="Subscribe to RSS feed"]', visible: false)
params = CGI.parse(URI.parse(link[:href]).query)
auto_discovery_link = find('link[type="application/atom+xml"]', visible: false)
auto_discovery_params = CGI.parse(URI.parse(auto_discovery_link[:href]).query)
expect(params).to include('feed_token' => [user.feed_token])
expect(params).to include('milestone_title' => [milestone.title])
expect(params).to include('assignee_id' => [user.id.to_s])
expect(auto_discovery_params).to include('feed_token' => [user.feed_token])
expect(auto_discovery_params).to include('milestone_title' => [milestone.title])
expect(auto_discovery_params).to include('assignee_id' => [user.id.to_s])
end
end
context 'URL has a trailing slash' do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment