summaryrefslogtreecommitdiffstats
path: root/test/unit/query_test.rb
diff options
context:
space:
mode:
authorJean-Baptiste Barth <jeanbaptiste.barth@gmail.com>2010-08-08 09:01:25 +0000
committerJean-Baptiste Barth <jeanbaptiste.barth@gmail.com>2010-08-08 09:01:25 +0000
commit56a6d86af572fb466bdd4f79b0a00dd69b87a3bb (patch)
treecca4311899d7de6f03deedc80f80564a66860615 /test/unit/query_test.rb
parentbc5d32d6de2c42aa084d2e5de0ef0c22da756a3a (diff)
downloadredmine-56a6d86af572fb466bdd4f79b0a00dd69b87a3bb.tar.gz
redmine-56a6d86af572fb466bdd4f79b0a00dd69b87a3bb.zip
Added project filter when viewing all issues. #5084
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@3927 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/unit/query_test.rb')
-rw-r--r--test/unit/query_test.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/unit/query_test.rb b/test/unit/query_test.rb
index 4b11830e8..12ab5d932 100644
--- a/test/unit/query_test.rb
+++ b/test/unit/query_test.rb
@@ -33,6 +33,15 @@ class QueryTest < ActiveSupport::TestCase
assert query.available_filters['fixed_version_id'][:values].detect {|v| v.last == '2'}
end
+ def test_project_filter_in_global_queries
+ query = Query.new(:project => nil, :name => '_')
+ project_filter = query.available_filters["project_id"]
+ assert_not_nil project_filter
+ project_ids = project_filter[:values].map{|p| p[1]}
+ assert project_ids.include?("1") #public project
+ assert !project_ids.include?("2") #private project user cannot see
+ end
+
def find_issues_with_query(query)
Issue.find :all,
:include => [ :assigned_to, :status, :tracker, :project, :priority ],