From ed01ae121daf44d1df43332b01f3d5f9d627a3d5 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Sat, 23 Jul 2011 19:05:22 +0000 Subject: Adds a optgroup for groups in users/groups select tags. git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@6307 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- test/unit/helpers/application_helper_test.rb | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'test') diff --git a/test/unit/helpers/application_helper_test.rb b/test/unit/helpers/application_helper_test.rb index 1d82dcb0e..d2e7cee62 100644 --- a/test/unit/helpers/application_helper_test.rb +++ b/test/unit/helpers/application_helper_test.rb @@ -675,4 +675,27 @@ RAW assert_equal %(eCookbook), link_to_project(project, {:action => 'settings'}, :class => "project") end + + def test_principals_options_for_select_with_users + users = [User.find(2), User.find(4)] + assert_equal %(), + principals_options_for_select(users) + end + + def test_principals_options_for_select_with_selected + users = [User.find(2), User.find(4)] + assert_equal %(), + principals_options_for_select(users, User.find(4)) + end + + def test_principals_options_for_select_with_users_and_groups + users = [User.find(2), Group.find(11), User.find(4), Group.find(10)] + assert_equal %() + + %(), + principals_options_for_select(users) + end + + def test_principals_options_for_select_with_empty_collection + assert_equal '', principals_options_for_select([]) + end end -- cgit v1.2.3