Project

General

Profile

Feature #23212 » 0001-Enable-to-display-subprojects-count.patch

Takenori TAKAKI, 2024-02-29 00:31

View differences:

app/views/projects/show.html.erb
<% if @subprojects.any? %>
<div class="projects box">
<h3 class="icon icon-projects"><%=l(:label_subproject_plural)%></h3>
<h3 class="icon icon-projects">
<%=l(:label_subproject_plural)%>
<span class="badge badge-count count"><%= @subprojects.count %></span>
</h3>
<ul class="subprojects">
<% @subprojects.each do |project| %>
<li><%= link_to(project.name, project_path(project), :class => project.css_classes).html_safe %></li>
test/functional/projects_controller_test.rb
assert_select 'a', :text => "Unarchive"
end
def test_show_should_display_subprojects_with_count
@request.session[:user_id] = 1
get(:show, :params => {:id => 'ecookbook'})
assert_response :success
assert_select 'div.projects>h3.icon>span.badge', :text => '3'
assert_select 'div.projects>ul.subprojects>li>a', :text => /Private child of eCookbook/, :count => 1
assert_select 'div.projects>ul.subprojects>li>a', :text => /eCookbook Subproject/, :count => 2
end
def test_show_should_not_show_private_subprojects_that_are_not_visible
get(:show, :params => {:id => 'ecookbook'})
assert_response :success
(2-2/3)