Repository navigation
Fix broken RFC embeds on the fundraising page - #2967
Conversation
…t the bottom on the impact their event has
8121914 to
8811d1a
Compare
|
|
||
| within "[data-test='fundraising-events']" do | ||
| expect(page).to have_css('.card').at_least(1) | ||
| page.all('.card').each do |card| |
There was a problem hiding this comment.
The CI RuboCop job is failing on this line (three offenses, this one plus lines 55 and 81):
spec/features/viewing_pages_spec.rb:40:25: C: [Correctable] Rails/FindEach: Use find_each instead of each.
Rails/FindEach exists to catch ActiveRecord scopes, where .each loads the whole relation into memory and .find_each batches. That doesn't apply here: page.all is Capybara, and it returns an in-memory snapshot of DOM elements, so there is nothing to batch. RuboCop thinks it is correctable, but autocorrecting to find_each would break the spec at runtime because Capybara elements have no find_each.
Suggested change — silence the cop just for these occurrences:
# rubocop:disable Rails/FindEach
page.all('.card').each do |card|
...
end
# rubocop:enable Rails/FindEach(spec/features is already excluded from some RuboCop checks, but inline disables keep the diff local. bundle exec rubocop passes on master, so the three new offenses are the only blockers on this PR.)
|
@mroderick This is now ready 🎉 |
|
Thaaaanks @olleolleolle 💃 |
Update fundraising page to include challenge events as the Run for Charity embeds were broken.
I've also added a new section on how fundraising helps codebar