Commit efed7fbe authored by jplang's avatar jplang

Fixe that filter "Assignee's group" doesn't work with group assignments (#13006).

git-svn-id: https://svn.redmine.org/redmine/trunk@11285 e93f8b46-1217-0410-a6f0-8f06a7374b81
parent b95f1ce9
......@@ -352,6 +352,7 @@ class IssueQuery < Query
members_of_groups = groups.inject([]) {|user_ids, group|
if group && group.user_ids.present?
user_ids << group.user_ids
user_ids << group.id
end
user_ids.flatten.uniq.compact
}.sort.collect(&:to_s)
......
......@@ -1124,7 +1124,7 @@ class QueryTest < ActiveSupport::TestCase
@query = IssueQuery.new(:name => '_')
@query.add_filter('member_of_group', '=', [@group.id.to_s])
assert_query_statement_includes @query, "#{Issue.table_name}.assigned_to_id IN ('#{@user_in_group.id}','#{@second_user_in_group.id}')"
assert_query_statement_includes @query, "#{Issue.table_name}.assigned_to_id IN ('#{@user_in_group.id}','#{@second_user_in_group.id}','#{@group.id}')"
assert_find_issues_with_query_is_successful @query
end
......@@ -1133,7 +1133,7 @@ class QueryTest < ActiveSupport::TestCase
@query.add_filter('member_of_group', '!*', [''])
# Users not in a group
assert_query_statement_includes @query, "#{Issue.table_name}.assigned_to_id IS NULL OR #{Issue.table_name}.assigned_to_id NOT IN ('#{@user_in_group.id}','#{@second_user_in_group.id}','#{@user_in_group2.id}')"
assert_query_statement_includes @query, "#{Issue.table_name}.assigned_to_id IS NULL OR #{Issue.table_name}.assigned_to_id NOT IN ('#{@user_in_group.id}','#{@second_user_in_group.id}','#{@user_in_group2.id}','#{@group.id}','#{@group2.id}')"
assert_find_issues_with_query_is_successful @query
end
......@@ -1142,7 +1142,7 @@ class QueryTest < ActiveSupport::TestCase
@query.add_filter('member_of_group', '*', [''])
# Only users in a group
assert_query_statement_includes @query, "#{Issue.table_name}.assigned_to_id IN ('#{@user_in_group.id}','#{@second_user_in_group.id}','#{@user_in_group2.id}')"
assert_query_statement_includes @query, "#{Issue.table_name}.assigned_to_id IN ('#{@user_in_group.id}','#{@second_user_in_group.id}','#{@user_in_group2.id}','#{@group.id}','#{@group2.id}')"
assert_find_issues_with_query_is_successful @query
end
......
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