summaryrefslogtreecommitdiffstats
path: root/test/unit/user_test.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2013-01-23 17:44:28 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2013-01-23 17:44:28 +0000
commite53a5de918c1db1f409df8d72a0cb5f38b4c7671 (patch)
treebea491687e40e92fa1713da2ba363cece392a24e /test/unit/user_test.rb
parentc7df78f3b6aee78403e8563b504e10770270fb24 (diff)
downloadredmine-e53a5de918c1db1f409df8d72a0cb5f38b4c7671.tar.gz
redmine-e53a5de918c1db1f409df8d72a0cb5f38b4c7671.zip
Adds "sorted" scope to Principal and User and sort users/groups properly.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11259 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/unit/user_test.rb')
-rw-r--r--test/unit/user_test.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/test/unit/user_test.rb b/test/unit/user_test.rb
index bf74dd6da..c0e51d469 100644
--- a/test/unit/user_test.rb
+++ b/test/unit/user_test.rb
@@ -34,6 +34,10 @@ class UserTest < ActiveSupport::TestCase
@dlopper = User.find(3)
end
+ def test_sorted_scope_should_sort_user_by_display_name
+ assert_equal User.all.map(&:name).map(&:downcase).sort, User.sorted.all.map(&:name).map(&:downcase)
+ end
+
def test_generate
User.generate!(:firstname => 'Testing connection')
User.generate!(:firstname => 'Testing connection')