diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2012-01-21 11:06:59 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2012-01-21 11:06:59 +0000 |
commit | 45e3dafa8fc7237ad49c6a7aa57d75e582c53d83 (patch) | |
tree | ff956aaaa9d93386320c457c02feae3c093c59cc /test | |
parent | 1d07bb91a7d1ec1c4eef3b4df5141419b35c213a (diff) | |
download | redmine-45e3dafa8fc7237ad49c6a7aa57d75e582c53d83.tar.gz redmine-45e3dafa8fc7237ad49c6a7aa57d75e582c53d83.zip |
Adds a <<me>> option at the top of the assignee drop-down (#1102).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@8688 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test')
-rw-r--r-- | test/unit/helpers/application_helper_test.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/test/unit/helpers/application_helper_test.rb b/test/unit/helpers/application_helper_test.rb index c98007790..3d98aafe8 100644 --- a/test/unit/helpers/application_helper_test.rb +++ b/test/unit/helpers/application_helper_test.rb @@ -854,18 +854,21 @@ RAW end def test_principals_options_for_select_with_users + User.current = nil users = [User.find(2), User.find(4)] assert_equal %(<option value="2">John Smith</option><option value="4">Robert Hill</option>), principals_options_for_select(users) end def test_principals_options_for_select_with_selected + User.current = nil users = [User.find(2), User.find(4)] assert_equal %(<option value="2">John Smith</option><option value="4" selected="selected">Robert Hill</option>), principals_options_for_select(users, User.find(4)) end def test_principals_options_for_select_with_users_and_groups + User.current = nil users = [User.find(2), Group.find(11), User.find(4), Group.find(10)] assert_equal %(<option value="2">John Smith</option><option value="4">Robert Hill</option>) + %(<optgroup label="Groups"><option value="10">A Team</option><option value="11">B Team</option></optgroup>), @@ -875,4 +878,10 @@ RAW def test_principals_options_for_select_with_empty_collection assert_equal '', principals_options_for_select([]) end + + def test_principals_options_for_select_should_include_me_option_when_current_user_is_in_collection + users = [User.find(2), User.find(4)] + User.current = User.find(4) + assert_include '<option value="4"><< me >></option>', principals_options_for_select(users) + end end |