summaryrefslogtreecommitdiffstats
path: root/test/unit/group_test.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/unit/group_test.rb')
-rw-r--r--test/unit/group_test.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/unit/group_test.rb b/test/unit/group_test.rb
index 703c423c1..9383cc7e7 100644
--- a/test/unit/group_test.rb
+++ b/test/unit/group_test.rb
@@ -158,4 +158,12 @@ class GroupTest < ActiveSupport::TestCase
end
assert_equal 0, group.reload.users.count
end
+
+ def test_sorted_scope_should_sort_groups_alphabetically
+ Group.delete_all
+ b = Group.generate!(:name => 'B')
+ a = Group.generate!(:name => 'A')
+
+ assert_equal %w(A B), Group.sorted.to_a.map(&:name)
+ end
end