comparison .svn/pristine/4c/4c88c6058655e1eb05ec3a1a293a556537a3380e.svn-base @ 1295:622f24f53b42 redmine-2.3

Update to Redmine SVN revision 11972 on 2.3-stable branch
author Chris Cannam
date Fri, 14 Jun 2013 09:02:21 +0100
parents
children
comparison
equal deleted inserted replaced
1294:3e4c3460b6ca 1295:622f24f53b42
1 # Redmine - project management software
2 # Copyright (C) 2006-2012 Jean-Philippe Lang
3 #
4 # This program is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU General Public License
6 # as published by the Free Software Foundation; either version 2
7 # of the License, or (at your option) any later version.
8 #
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
13 #
14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, write to the Free Software
16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17
18 require File.expand_path('../../../test_helper', __FILE__)
19
20 class QueriesHelperTest < ActionView::TestCase
21 include QueriesHelper
22 include Redmine::I18n
23
24 fixtures :projects, :enabled_modules, :users, :members,
25 :member_roles, :roles, :trackers, :issue_statuses,
26 :issue_categories, :enumerations, :issues,
27 :watchers, :custom_fields, :custom_values, :versions,
28 :queries,
29 :projects_trackers,
30 :custom_fields_trackers
31
32 def test_order
33 User.current = User.find_by_login('admin')
34 query = Query.new(:project => nil, :name => '_')
35 assert_equal 30, query.available_filters.size
36 fo = filters_options(query)
37 assert_equal 31, fo.size
38 assert_equal [], fo[0]
39 assert_equal "status_id", fo[1][1]
40 assert_equal "project_id", fo[2][1]
41 assert_equal "tracker_id", fo[3][1]
42 assert_equal "priority_id", fo[4][1]
43 assert_equal "watcher_id", fo[17][1]
44 assert_equal "is_private", fo[18][1]
45 end
46
47 def test_order_custom_fields
48 set_language_if_valid 'en'
49 field = UserCustomField.new(
50 :name => 'order test', :field_format => 'string',
51 :is_for_all => true, :is_filter => true
52 )
53 assert field.save
54 User.current = User.find_by_login('admin')
55 query = Query.new(:project => nil, :name => '_')
56 assert_equal 32, query.available_filters.size
57 fo = filters_options(query)
58 assert_equal 33, fo.size
59 assert_equal "Searchable field", fo[19][0]
60 assert_equal "Database", fo[20][0]
61 assert_equal "Project's Development status", fo[21][0]
62 assert_equal "Assignee's order test", fo[22][0]
63 assert_equal "Author's order test", fo[23][0]
64 end
65 end