summaryrefslogtreecommitdiffstats
path: root/test/functional/issues_controller_test.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2012-08-07 19:17:59 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2012-08-07 19:17:59 +0000
commit3676783052fed523c23247fb8181124e918dd4e1 (patch)
treeffcddde17e6c732a97ab0b8c25b66e2c9e3eed1e /test/functional/issues_controller_test.rb
parent599736aca7b9b5bd47d39fdf72c9fc1127730497 (diff)
downloadredmine-3676783052fed523c23247fb8181124e918dd4e1.tar.gz
redmine-3676783052fed523c23247fb8181124e918dd4e1.zip
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
Diffstat (limited to 'test/functional/issues_controller_test.rb')
-rw-r--r--test/functional/issues_controller_test.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/functional/issues_controller_test.rb b/test/functional/issues_controller_test.rb
index b554e9e5f..ee18dadb2 100644
--- a/test/functional/issues_controller_test.rb
+++ b/test/functional/issues_controller_test.rb
@@ -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