summaryrefslogtreecommitdiffstats
path: root/test/unit/helpers/queries_helper_test.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2013-02-14 20:37:17 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2013-02-14 20:37:17 +0000
commit0be82ea2c45eb2d95e5cde32365dea8a5b333123 (patch)
tree32ddf23e177c988959f2a8a1797356ac46f4592f /test/unit/helpers/queries_helper_test.rb
parentf77edce621c6841c507ed3925ce04d01f2ad986b (diff)
downloadredmine-0be82ea2c45eb2d95e5cde32365dea8a5b333123.tar.gz
redmine-0be82ea2c45eb2d95e5cde32365dea8a5b333123.zip
Refactor: use an ordered hash to store available filters and remove :order option (#13154).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11372 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/unit/helpers/queries_helper_test.rb')
-rw-r--r--test/unit/helpers/queries_helper_test.rb15
1 files changed, 7 insertions, 8 deletions
diff --git a/test/unit/helpers/queries_helper_test.rb b/test/unit/helpers/queries_helper_test.rb
index d32959efe..81604a38b 100644
--- a/test/unit/helpers/queries_helper_test.rb
+++ b/test/unit/helpers/queries_helper_test.rb
@@ -29,7 +29,7 @@ class QueriesHelperTest < ActionView::TestCase
:projects_trackers,
:custom_fields_trackers
- def test_order
+ def test_filters_options_should_be_ordered
User.current = User.find_by_login('admin')
query = IssueQuery.new(:project => nil, :name => '_')
assert_equal 30, query.available_filters.size
@@ -40,17 +40,16 @@ class QueriesHelperTest < ActionView::TestCase
assert_equal "project_id", fo[2][1]
assert_equal "tracker_id", fo[3][1]
assert_equal "priority_id", fo[4][1]
- assert_equal "watcher_id", fo[17][1]
- assert_equal "is_private", fo[18][1]
+ assert_equal "is_private", fo[17][1]
+ assert_equal "watcher_id", fo[18][1]
end
- def test_order_custom_fields
+ def test_filters_options_should_be_ordered_with_custom_fields
set_language_if_valid 'en'
- field = UserCustomField.new(
+ field = UserCustomField.create!(
:name => 'order test', :field_format => 'string',
:is_for_all => true, :is_filter => true
)
- assert field.save
User.current = User.find_by_login('admin')
query = IssueQuery.new(:project => nil, :name => '_')
assert_equal 32, query.available_filters.size
@@ -59,7 +58,7 @@ class QueriesHelperTest < ActionView::TestCase
assert_equal "Searchable field", fo[19][0]
assert_equal "Database", fo[20][0]
assert_equal "Project's Development status", fo[21][0]
- assert_equal "Assignee's order test", fo[22][0]
- assert_equal "Author's order test", fo[23][0]
+ assert_equal "Author's order test", fo[22][0]
+ assert_equal "Assignee's order test", fo[23][0]
end
end