diff options
Diffstat (limited to 'test/helpers')
-rw-r--r-- | test/helpers/application_helper_test.rb | 24 | ||||
-rw-r--r-- | test/helpers/watchers_helper_test.rb | 30 |
2 files changed, 5 insertions, 49 deletions
diff --git a/test/helpers/application_helper_test.rb b/test/helpers/application_helper_test.rb index dce3c3d25..fabaa31ed 100644 --- a/test/helpers/application_helper_test.rb +++ b/test/helpers/application_helper_test.rb @@ -2008,31 +2008,18 @@ class ApplicationHelperTest < Redmine::HelperTest end def test_principals_check_box_tag_with_avatar - principals = [User.find(1), User.find(2)] + principals = [User.find(1), Group.find(10)] with_settings :gravatar_enabled => '1' do tags = principals_check_box_tags("watcher[user_ids][]", principals) principals.each do |principal| assert_include avatar(principal, :size => 16), tags - assert_include content_tag('span', nil, :class => "name icon icon-#{principal.class.name.downcase}"), tags - assert_include principal.to_s, tags + assert_not_include content_tag('span', nil, :class => "name icon icon-#{principal.class.name.downcase}"), tags end end end - def test_principals_check_box_tag_without_avatar_when_principal_is_group - principals = [Group.find(10), Group.find(11)] - with_settings :gravatar_enabled => '1' do - tags = principals_check_box_tags("watcher[user_ids][]", principals) - principals.each do |principal| - assert_not_include avatar(principal, :size => 16), tags - assert_include content_tag('span', principal_icon(principal), :class => "name icon icon-#{principal.class.name.downcase}"), tags - assert_include principal.to_s, tags - end - end - end - - def test_principals_check_box_tag_without_avatar_when_gravatar_disabled - principals = [User.find(1), User.find(2)] + def test_principals_check_box_tag_without_avatar + principals = [User.find(1), Group.find(10)] Setting.gravatar_enabled = '1' avatar_tags = principals.collect{|p| avatar(p, :size => 16)} @@ -2040,8 +2027,7 @@ class ApplicationHelperTest < Redmine::HelperTest tags = principals_check_box_tags(name, principals) principals.each_with_index do |principal, i| assert_not_include avatar_tags[i], tags - assert_include content_tag('span', nil, :class => "name icon icon-#{principal.class.name.downcase}"), tags - assert_include principal.to_s, tags + assert_include content_tag('span', principal_icon(principal), :class => "name icon icon-#{principal.class.name.downcase}"), tags end end end diff --git a/test/helpers/watchers_helper_test.rb b/test/helpers/watchers_helper_test.rb index f1f0ff8c0..1d29d33d5 100644 --- a/test/helpers/watchers_helper_test.rb +++ b/test/helpers/watchers_helper_test.rb @@ -94,34 +94,4 @@ class WatchersHelperTest < Redmine::HelperTest end end end - - def test_watchers_list_should_include_avatar_and_user_name - issue = Issue.find(1) - Watcher.create!(:watchable => issue, :user => User.find(1)) - - with_settings :gravatar_enabled => '1' do - result = watchers_list(issue) - assert_select_in result, 'ul.watchers' do - assert_select 'li', 1 - assert_select 'li:nth-of-type(1)>img.gravatar', 1 - assert_select 'li:nth-of-type(1)>a[href=?]', '/users/1', text: 'Redmine Admin' - assert_select 'li:nth-of-type(1)>a.group>svg.icon-svg', 0 - end - end - end - - def test_watchers_list_should_include_svg_icon_and_group_name - issue = Issue.find(1) - Watcher.create!(:watchable => issue, :user => Group.find(10)) - - with_settings :gravatar_enabled => '1' do - result = watchers_list(issue) - assert_select_in result, 'ul.watchers' do - assert_select 'li', 1 - assert_select 'li:nth-of-type(1)>a.group>svg.icon-svg', 1 - assert_select 'li:nth-of-type(1)>a[href=?]', '/groups/10', text: 'A Team' - assert_select 'li:nth-of-type(1)>img.gravatar', 0 - end - end - end end |