Permalink
Browse files

In tests there are not always ministers associated with organisations.

This should fix the build.
  • Loading branch information...
1 parent 10e6760 commit b44304ea62a4f6e3837ed423ef2149f49d073753 @lazyatom lazyatom committed Feb 2, 2012
Showing with 11 additions and 9 deletions.
  1. +11 −9 app/views/organisations/show.html.erb
@@ -13,15 +13,17 @@
</p>
</div>
<div class="g1">
- <section id="ministers">
- <%= render_list_of_ministerial_roles([@organisation.top_ministerial_role]) do |ministerial_role| %>
- <div class="image_holder">
- <%= image_for_ministerial_role(ministerial_role) %>
- </div>
- <h3><%= link_to ministerial_role.name, ministerial_role %></h3>
- <p class="current_appointee"><%= ministerial_role.current_person_name %></p>
- <% end %>
- </section>
+ <% if @organisation.ministerial_roles.any? %>
+ <section id="ministers">
+ <%= render_list_of_ministerial_roles([@organisation.top_ministerial_role]) do |ministerial_role| %>
+ <div class="image_holder">
+ <%= image_for_ministerial_role(ministerial_role) %>
+ </div>
+ <h3><%= link_to ministerial_role.name, ministerial_role %></h3>
+ <p class="current_appointee"><%= ministerial_role.current_person_name %></p>
+ <% end %>
+ </section>
+ <% end %>
</div>
</div>
<% end %>

0 comments on commit b44304e

Please sign in to comment.