mirror of
https://github.com/redmine/redmine.git
synced 2026-05-07 15:07:14 +02:00
Ability to filter issues using project, author, assignee and target version custom fields (#8161).
Custom fields must be marked as "Used as filter" to show up in the filters list. git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10164 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -230,6 +230,22 @@ class IssuesControllerTest < ActionController::TestCase
|
||||
assert_equal({}, query.filters)
|
||||
end
|
||||
|
||||
def test_index_with_project_custom_field_filter
|
||||
field = ProjectCustomField.create!(:name => 'Client', :is_filter => true, :field_format => 'string')
|
||||
CustomValue.create!(:custom_field => field, :customized => Project.find(3), :value => 'Foo')
|
||||
CustomValue.create!(:custom_field => field, :customized => Project.find(5), :value => 'Foo')
|
||||
filter_name = "project.cf_#{field.id}"
|
||||
@request.session[:user_id] = 1
|
||||
|
||||
get :index, :set_filter => 1,
|
||||
:f => [filter_name],
|
||||
:op => {filter_name => '='},
|
||||
:v => {filter_name => ['Foo']}
|
||||
assert_response :success
|
||||
assert_template 'index'
|
||||
assert_equal [3, 5], assigns(:issues).map(&:project_id).uniq.sort
|
||||
end
|
||||
|
||||
def test_index_with_query
|
||||
get :index, :project_id => 1, :query_id => 5
|
||||
assert_response :success
|
||||
|
||||
Reference in New Issue
Block a user