From fecd2995f957c0c74f85d08e1828f6688ae8f08f Mon Sep 17 00:00:00 2001 From: Marius BALTEANU Date: Sun, 2 Dec 2018 20:53:18 +0000 Subject: [PATCH] Show assignee avatar in Roadmap and Version --- app/views/versions/index.html.erb | 4 ++-- app/views/versions/show.html.erb | 2 +- test/functional/versions_controller_test.rb | 32 +++++++++++++++++++++++++++++ 3 files changed, 35 insertions(+), 3 deletions(-) diff --git a/app/views/versions/index.html.erb b/app/views/versions/index.html.erb index 429bc5b..856ee69 100644 --- a/app/views/versions/index.html.erb +++ b/app/views/versions/index.html.erb @@ -28,9 +28,9 @@ <% issues.each do |issue| -%> - + - + <% end -%> diff --git a/app/views/versions/show.html.erb b/app/views/versions/show.html.erb index ad3ed25..6092c97 100644 --- a/app/views/versions/show.html.erb +++ b/app/views/versions/show.html.erb @@ -44,7 +44,7 @@ <%- @issues.each do |issue| -%> - + <% end %> diff --git a/test/functional/versions_controller_test.rb b/test/functional/versions_controller_test.rb index b827a1f..bc9d270 100644 --- a/test/functional/versions_controller_test.rb +++ b/test/functional/versions_controller_test.rb @@ -98,12 +98,44 @@ class VersionsControllerTest < Redmine::ControllerTest end end + def test_index_should_show_issue_assignee + with_settings :gravatar_enabled => '1' do + Issue.generate!(:project_id => 3, :fixed_version_id => 4, :assigned_to => User.find_by_login('jsmith')) + Issue.generate!(:project_id => 3, :fixed_version_id => 4) + + get :index, :params => {:project_id => 3} + assert_response :success + + assert_select 'table.related-issues' do + assert_select 'tr.issue', :count => 2 do + assert_select 'img.gravatar.icon-gravatar[title=?]', 'Assignee: John Smith', :count => 1 + end + end + end + end + def test_show get :show, :params => {:id => 2} assert_response :success assert_select 'h2', :text => /1.0/ assert_select 'span[class=?]', 'badge badge-status-locked', :text => 'locked' + + # no issue avatar when gravatar is disabled + assert_select 'img.gravatar', :count => 0 + end + + def test_show_should_show_issue_assignee + with_settings :gravatar_enabled => '1' do + get :show, :params => {:id => 2} + assert_response :success + + assert_select 'table.related-issues' do + assert_select 'tr.issue', :count => 2 do + assert_select 'img.gravatar.icon-gravatar[title=?]', 'Assignee: Dave Lopper', :count => 1 + end + end + end end def test_show_issue_calculations_should_take_into_account_only_visible_issues -- 2.1.4