Project

General

Profile

Patch #28510 » 0001-Show-assignee-avatar-in-Roadmap-and-Version.patch

Marius BĂLTEANU, 2019-05-18 15:40

View differences:

app/views/versions/index.html.erb
28 28
        <table class="list related-issues">
29 29
        <caption><%= l(:label_related_issues) %></caption>
30 30
        <% issues.each do |issue| -%>
31
          <tr class="hascontextmenu">
31
          <tr class="issue hascontextmenu">
32 32
            <td class="checkbox"><%= check_box_tag 'ids[]', issue.id, false, :id => nil %></td>
33
            <td class="subject"><%= link_to_issue(issue, :project => (@project != issue.project)) %></td>
33
            <td class="subject"><%= assignee_avatar(issue.assigned_to, :size => 16, :class => 'icon-gravatar').html_safe + link_to_issue(issue, :project => (@project != issue.project)) %></td>
34 34
            <td class="buttons"><%= link_to_context_menu %></td>
35 35
          </tr>
36 36
        <% end -%>
app/views/versions/show.html.erb
44 44
  <%- @issues.each do |issue| -%>
45 45
    <tr class="issue hascontextmenu">
46 46
      <td class="checkbox"><%= check_box_tag 'ids[]', issue.id, false, :id => nil %></td>
47
      <td class="subject"><%= link_to_issue(issue, :project => (@project != issue.project)) %></td>
47
      <td class="subject"><%= assignee_avatar(issue.assigned_to, :size => 16, :class => 'icon-gravatar').html_safe + link_to_issue(issue, :project => (@project != issue.project)) %></td>
48 48
      <td class="buttons"><%= link_to_context_menu %></td>
49 49
    </tr>
50 50
  <% end %>
test/functional/versions_controller_test.rb
98 98
    end
99 99
  end
100 100

  
101
  def test_index_should_show_issue_assignee
102
    with_settings :gravatar_enabled => '1' do
103
      Issue.generate!(:project_id => 3, :fixed_version_id => 4, :assigned_to => User.find_by_login('jsmith'))
104
      Issue.generate!(:project_id => 3, :fixed_version_id => 4)
105

  
106
      get :index, :params => {:project_id => 3}
107
      assert_response :success
108

  
109
      assert_select 'table.related-issues' do
110
        assert_select 'tr.issue', :count => 2 do
111
          assert_select 'img.gravatar.icon-gravatar[title=?]', 'Assignee: John Smith', :count => 1
112
        end
113
      end
114
    end
115
  end
116

  
101 117
  def test_show
102 118
    get :show, :params => {:id => 2}
103 119
    assert_response :success
104 120

  
105 121
    assert_select 'h2', :text => /1.0/
106 122
    assert_select 'span[class=?]', 'badge badge-status-locked', :text => 'locked'
123

  
124
    # no issue avatar when gravatar is disabled
125
    assert_select 'img.gravatar', :count => 0
126
  end
127

  
128
  def test_show_should_show_issue_assignee
129
    with_settings :gravatar_enabled => '1' do
130
      get :show, :params => {:id => 2}
131
      assert_response :success
132

  
133
      assert_select 'table.related-issues' do
134
        assert_select 'tr.issue', :count => 2 do
135
          assert_select 'img.gravatar.icon-gravatar[title=?]', 'Assignee: Dave Lopper', :count => 1
136
        end
137
      end
138
    end
107 139
  end
108 140

  
109 141
  def test_show_issue_calculations_should_take_into_account_only_visible_issues
(9-9/12)