diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2016-12-03 08:26:08 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2016-12-03 08:26:08 +0000 |
commit | e22159a3cb721384de38166e4a014f08ebe08829 (patch) | |
tree | 8e1c9f43be68ff5aea29199e47a43ed335aca896 /test/unit/member_test.rb | |
parent | 8aa6089171793590c1f8c92f123ea556b577fcb9 (diff) | |
download | redmine-e22159a3cb721384de38166e4a014f08ebe08829.tar.gz redmine-e22159a3cb721384de38166e4a014f08ebe08829.zip |
Sort members on the DB side.
git-svn-id: http://svn.redmine.org/redmine/trunk@16040 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/unit/member_test.rb')
-rw-r--r-- | test/unit/member_test.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/test/unit/member_test.rb b/test/unit/member_test.rb index d0e2ea042..ce9898f4b 100644 --- a/test/unit/member_test.rb +++ b/test/unit/member_test.rb @@ -38,6 +38,12 @@ class MemberTest < ActiveSupport::TestCase @jsmith = Member.find(1) end + def test_sorted_scope_on_project_members + members = Project.find(1).members.sorted.to_a + roles = members.map {|m| m.roles.sort.first} + assert_equal roles, roles.sort + end + def test_create member = Member.new(:project_id => 1, :user_id => 4, :role_ids => [1, 2]) assert member.save |