codebar / planner

🗓 the main codebar site
https://codebar.io
MIT License
92 stars 192 forks source link

Fix showing duplicate sponsors #2065

Closed biggianteye closed 4 months ago

biggianteye commented 4 months ago

This is a fix for https://github.com/codebar/planner/issues/1839

When filtering by chapter, the page was displaying a sponsor row for every workshop, like this:

image

This PR fixes the display so that it only shows the chapter once, like this:

image
biggianteye commented 4 months ago

The build pipeline is failing on this test:

  1) Member portal A non authenticated visitor to the page is redirected to sign_in page when they attempt not access the profile page
     Failure/Error: session[:oauth_token]        = omnihash[:credentials][:token]

     NoMethodError:
       undefined method `[]' for nil:NilClass
     # ./app/controllers/auth_services_controller.rb:48:in `create'
     # ./spec/features/member_portal_spec.rb:95:in `block (3 levels) in <top (required)>'
     # ./spec/spec_helper.rb:114:in `block (2 levels) in <top (required)>'

Finished in 4 minutes 40.5 seconds (files took 5.06 seconds to load)
744 examples, 1 failure

Failed examples:

rspec ./spec/features/member_portal_spec.rb:94 # Member portal A non authenticated visitor to the page is redirected to sign_in page when they attempt not access the profile page

As far as I can see, this part of the code should not be affected by the changes that I made. I have run all the tests on my machine and don't see this failure.

@KimberleyCook Could you please re-run that part of the build pipeline and see if it still fails?

KimberleyCook commented 4 months ago

@biggianteye thank you so much for this 🎉 🎉

matyikriszta commented 4 months ago

@KimberleyCook @biggianteye I was going to comment on this before we merged it, I was going to ask that we update the relevant tests to cover the case when a sponsor has hosted more than one workshop, clearly we missed it when we were working on this feature originally. Test are in spec/features/admin/sponsor_spec.rb

biggianteye commented 4 months ago

update the relevant tests to cover the case when a sponsor has hosted more than one workshop

I'll have a go at this.