Skip to content
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 app/controllers/admin/members_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ def show
def events
load_attendance_data(@member)

past_rsvps = @member.past_rsvps
@pagy, @past_rsvps = pagy(:offset, items: past_rsvps)
@member = MemberPresenter.new(@member)
@pagy, @past_rsvps = pagy(:offset, @member.past_rsvps)
end

def update_subscriptions
Expand Down
4 changes: 2 additions & 2 deletions app/views/admin/members/events.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@

- if @past_rsvps.any?
%h3 Past RSVPs
= render partial: 'shared/pagination', locals: { pagy: @pagy, model: 'events' }
= render partial: 'shared/pagination', locals: { pagy: @pagy, model: 'event' }

- @past_rsvps.each do |invitation|
= render EventPresenter.decorate(invitation.event), invitation: invitation

= render partial: 'shared/pagination', locals: { pagy: @pagy, model: 'events' }
= render partial: 'shared/pagination', locals: { pagy: @pagy, model: 'event' }
2 changes: 1 addition & 1 deletion app/views/shared/_pagination.html.haml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.row.align-items-center.justify-content-between
.col-auto
%p.mb-3
!= pagy.info_tag(item_name: model.pluralize(pagy.count))
!= pagy.info_tag(item_name: model)
.col-auto
!= pagy.series_nav(:bootstrap) if pagy.pages > 1
7 changes: 7 additions & 0 deletions spec/features/admin/members_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,13 @@
end
end

it 'can view paginated list of past RSVPs' do
click_on 'View all RSVPS'

expect(page).to have_content('Past RSVPs')
expect(page).to have_content('Displaying 1 event')
end

it 'can add a note about a member' do
click_on 'Add note'
fill_in 'member_note_note', with: 'Bananas and custard'
Expand Down
2 changes: 1 addition & 1 deletion spec/features/admin/sponsor_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
click_on 'Filter'

expect(page.all(:css, 'tbody tr', count: 0))
expect(page).to have_content('No sponsors found')
expect(page).to have_content('No sponsor found')
end

scenario 'can clear filtering form' do
Expand Down