Skip to content

Commit

Permalink
add owned events to organizations show
Browse files Browse the repository at this point in the history
  • Loading branch information
raul-fuentes committed Dec 14, 2017
1 parent e827166 commit 1f64276
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 2 deletions.
17 changes: 17 additions & 0 deletions app/views/organizations/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -212,5 +212,22 @@
</ul>
</div>
</li>
<li class="accordion-navigation">
<a href="#panel8">
<%= t('organizations.show.events_title') %>
<span class="fa accordion-icon"></span>
</a>
<div id="panel8" class="content">
<ul>
<% if @organization.events.each do |event| %>
<li>
<p><%= link_to event.title, event_path(event) %></p>
</li>
<% end.empty? %>
<%= t('organizations.show.no_results') %>
<% end %>
</ul>
</div>
</li>
</ul>
</div>
2 changes: 2 additions & 0 deletions config/locales/organizations.en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ en:

interests_title: "Area de interés"

events_title: "Events"

new:
title: Registration in lobbies

Expand Down
6 changes: 4 additions & 2 deletions config/locales/organizations.es.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,9 @@ es:
agents_to: "Fecha de fin de representación"

interests_title: "Area de interés"


events_title: "Eventos"

new:
title: Alta en el registro de lobbies

Expand All @@ -71,7 +73,7 @@ es:

delete:
title: Baja en el registro de lobbies

backend:
new_organization_title: "Nueva organización"
reference:
Expand Down
13 changes: 13 additions & 0 deletions spec/features/organizations_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,19 @@
expect(page).to have_content interest2.name
end

scenario "Should display organization event" do
organization = create(:organization)
event1 = create(:event)
event2 = create(:event)
organization.events << event1
organization.events << event2

visit organization_path(organization)

expect(page).to have_content event1.title
expect(page).to have_content event2.title
end

scenario "Should return to organizations index page" do
organization = create(:organization)
visit organization_path(organization)
Expand Down

0 comments on commit 1f64276

Please sign in to comment.