31066.patch

Takenori TAKAKI, 2019-03-20 09:11

Download (2.18 KB)

View differences:

app/views/users/show.html.erb
77 77

  
78 78
<% unless @memberships.empty? %>
79 79
<h3><%=l(:label_project_plural)%></h3>
80
<ul>
80
<table class="list memberships">
81
<thead>
82
  <tr>
83
    <th><%=l(:label_project)%></th>
84
    <th><%=l(:label_role_plural)%></th>
85
    <th><%=l(:label_registered_on)%></th>
86
  </tr>
87
</thead>
88
<tbody>
81 89
<% for membership in @memberships %>
82
  <li><%= link_to_project(membership.project) %>
83
    (<%= membership.roles.sort.collect(&:to_s).join(', ') %>, <%= format_date(membership.created_on) %>)</li>
90
  <tr>
91
    <td class="project name"><%= link_to_project(membership.project) %></td>
92
    <td class="roles"><%= membership.roles.sort.collect(&:to_s).join(', ') %></td>
93
    <td><%= format_date(membership.created_on) %></td>
94
  </tr>
84 95
<% end %>
85
</ul>
96
</tbody>
97
</table>
86 98
<% end %>
87 99

  
88 100
<% if (User.current == @user || User.current.admin?) && @user.groups.any? %>
test/functional/users_controller_test.rb
174 174
    assert_response :success
175 175

  
176 176
    # membership of private project admin can see
177
    assert_select 'li a', :text => "OnlineStore"
177
    #assert_select 'li a', :text => "OnlineStore"
178
    assert_select 'table.list.memberships>tbody' do
179
      assert_select 'tr:nth-of-type(1)' do
180
        assert_select 'td:nth-of-type(1)>a', :text => 'eCookbook'
181
        assert_select 'td:nth-of-type(2)', :text => 'Manager'
182
      end
183
      assert_select 'tr:nth-of-type(2)' do
184
        assert_select 'td:nth-of-type(1)>a', :text => 'OnlineStore'
185
        assert_select 'td:nth-of-type(2)', :text => 'Developer'
186
      end
187
      assert_select 'tr:nth-of-type(3)' do
188
        assert_select 'td:nth-of-type(1)>a', :text => 'Private child of eCookbook'
189
        assert_select 'td:nth-of-type(2)', :text => 'Manager'
190
      end
191
    end
178 192
  end
179 193

  
180 194
  def test_show_current_should_require_authentication