summaryrefslogtreecommitdiffstats
path: root/test/unit/helpers
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2014-10-04 09:36:35 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2014-10-04 09:36:35 +0000
commit8b998ec05ba92082beb8265f5403bc0ec945a0ed (patch)
tree8b63447d5482e7bab971e0b78550c05c8798df4e /test/unit/helpers
parent2e9b28906db62f5ef5b2663f68d395a8e261959c (diff)
downloadredmine-8b998ec05ba92082beb8265f5403bc0ec945a0ed.tar.gz
redmine-8b998ec05ba92082beb8265f5403bc0ec945a0ed.zip
Adds css classes to get sort order on the issue list (#17993).
git-svn-id: http://svn.redmine.org/redmine/trunk@13425 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/unit/helpers')
-rw-r--r--test/unit/helpers/sort_helper_test.rb22
1 files changed, 22 insertions, 0 deletions
diff --git a/test/unit/helpers/sort_helper_test.rb b/test/unit/helpers/sort_helper_test.rb
index e66a591ef..0c79f8c2a 100644
--- a/test/unit/helpers/sort_helper_test.rb
+++ b/test/unit/helpers/sort_helper_test.rb
@@ -78,6 +78,28 @@ class SortHelperTest < ActionView::TestCase
assert_equal 'attr1,attr2', @session['foo_bar_sort']
end
+ def test_sort_css_without_params_should_use_default_sort
+ sort_init 'attr1', 'desc'
+ sort_update(['attr1', 'attr2'])
+
+ assert_equal 'sort-by-attr1 sort-desc', sort_css_classes
+ end
+
+ def test_sort_css_should_use_params
+ @sort_param = 'attr2,attr1'
+ sort_init 'attr1', 'desc'
+ sort_update(['attr1', 'attr2'])
+
+ assert_equal 'sort-by-attr2 sort-asc', sort_css_classes
+ end
+
+ def test_sort_css_should_dasherize_sort_name
+ sort_init 'foo_bar'
+ sort_update(['foo_bar'])
+
+ assert_equal 'sort-by-foo-bar sort-asc', sort_css_classes
+ end
+
private
def controller_name; 'foo'; end