diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2012-07-05 13:51:56 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2012-07-05 13:51:56 +0000 |
commit | 196f96fff1d93ba55453166192cb242da048a742 (patch) | |
tree | 718bcea4969e41e7e0b80c5d2a51d12617876d43 /test/unit | |
parent | 1d7c0eb7c02d22f65ed1e4443abcf92b5bd7a899 (diff) | |
download | redmine-196f96fff1d93ba55453166192cb242da048a742.tar.gz redmine-196f96fff1d93ba55453166192cb242da048a742.zip |
Adds Private filter to the issue list (#8577).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@9920 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/unit')
-rw-r--r-- | test/unit/query_test.rb | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/test/unit/query_test.rb b/test/unit/query_test.rb index 61f7a4b01..522d8d0a3 100644 --- a/test/unit/query_test.rb +++ b/test/unit/query_test.rb @@ -258,6 +258,36 @@ class QueryTest < ActiveSupport::TestCase assert issues.map(&:id).include?(3) end + def test_operator_is_on_is_private_field + # is_private filter only available for those who can set issues private + User.current = User.find(2) + + query = Query.new(:name => '_') + assert query.available_filters.key?('is_private') + + query.add_filter("is_private", '=', ['1']) + issues = find_issues_with_query(query) + assert issues.any? + assert_nil issues.detect {|issue| !issue.is_private?} + ensure + User.current = nil + end + + def test_operator_is_not_on_is_private_field + # is_private filter only available for those who can set issues private + User.current = User.find(2) + + query = Query.new(:name => '_') + assert query.available_filters.key?('is_private') + + query.add_filter("is_private", '!', ['1']) + issues = find_issues_with_query(query) + assert issues.any? + assert_nil issues.detect {|issue| issue.is_private?} + ensure + User.current = nil + end + def test_operator_greater_than query = Query.new(:project => Project.find(1), :name => '_') query.add_filter('done_ratio', '>=', ['40']) |