Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename PersonCard#memberships to PersonCard#legislative_memberships #15620

Merged
merged 1 commit into from
Feb 28, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/person_cards.rb
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,9 @@ def identifiers
Section::Identifiers.new(person, top_identifiers: top_identifiers).data
end

# List of memberships this person held in this term
# List of legislative memberships this person held in this term
# @return [Array<EveryPolitician::Popolo::Membership>]
def memberships
def legislative_memberships
person.memberships.where(legislative_period_id: term.id)
end

Expand Down
12 changes: 6 additions & 6 deletions t/page/term_table.rb
Original file line number Diff line number Diff line change
Expand Up @@ -87,12 +87,12 @@
'Austria/Nationalrat/2e8b774e-ae66-4137-a984-aac74917df87/140x140.jpeg'
end

it 'has a single membership' do
af.memberships.count.must_equal 1
af.memberships.first.start_date.must_equal '2013-10-29'
af.memberships.first.end_date.must_equal nil
af.memberships.first.group.name.must_equal 'ÖVP'
af.memberships.first.area.name.must_equal 'Wahlkreis: 3B – Waldviertel'
it 'has a single legislative membership' do
af.legislative_memberships.count.must_equal 1
af.legislative_memberships.first.start_date.must_equal '2013-10-29'
af.legislative_memberships.first.end_date.must_equal nil
af.legislative_memberships.first.group.name.must_equal 'ÖVP'
af.legislative_memberships.first.area.name.must_equal 'Wahlkreis: 3B – Waldviertel'
end

it 'has two entries on bio card' do
Expand Down
2 changes: 1 addition & 1 deletion views/term_table.erb
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@

<h3 class="person-card__name"><%= person.name %></h3>

<% person.memberships.each do |mem| %>
<% person.legislative_memberships.each do |mem| %>
<p class="person-card__politics">

<%= [mem.group, mem.area].reject(&:nil?).map(&:name).join(" — ") %>
Expand Down