Browse files

Link to ministers page from organisation pages

  • Loading branch information...
1 parent 3169b12 commit c3e40fdc68aaae07cb5179a36dd0de41df412181 @tomstuart tomstuart committed Feb 3, 2012
Showing with 12 additions and 0 deletions.
  1. +1 −0 app/views/organisations/show.html.erb
  2. +11 −0 test/functional/organisations_controller_test.rb
View
1 app/views/organisations/show.html.erb
@@ -29,6 +29,7 @@
</h3>
<p class="current_appointee"><%= role.current_person_name %></p>
<% end %>
+ <p>View all <%= @organisation.name %> <%= link_to 'ministers', ministers_organisation_path(@organisation) %></p>
</section>
<% end %>
</div>
View
11 test/functional/organisations_controller_test.rb
@@ -452,6 +452,17 @@ class OrganisationsControllerTest < ActionController::TestCase
refute_select "#other_board_members"
end
+ test "should link to the organisation's ministers page" do
+ organisation = create(:organisation)
+ role = create(:ministerial_role, organisations: [organisation])
+ role_appointment = create(:ministerial_role_appointment, role: role)
+ speech = create(:published_speech, role_appointment: role_appointment)
+
+ get :show, id: organisation
+
+ assert_select '#ministers a[href=?]', ministers_organisation_path(organisation)
+ end
+
test "shows only published policies associated with organisation on policies page" do
published_policy = create(:published_policy)
draft_policy = create(:draft_policy)

0 comments on commit c3e40fd

Please sign in to comment.