Files
growstuff/spec
Brenda WallaceandClaude Opus 5 6dbab4678f Stop avatars shifting the page during feature specs (#4847)
* Stop avatars shifting the page during feature specs

spec/features/places/searching_a_place_spec.rb intermittently failed on
"goes to members' index page": the click on "View all members >>" landed
on nothing and the browser stayed put.

Member avatars come from gravatar.com over the network and were rendered
with img-fluid and no dimensions, so they reserved no space until they
arrived. The link sits directly under that grid. Capybara found the link,
an avatar landed, the link moved, and the click missed.

rails_helper meant to prevent this, but its guard tested for Poltergeist's
url_blacklist. Poltergeist is long gone and Selenium's browser has no such
method, so the condition was always false and the block never ran.

- Give the two avatar image tags explicit width and height, so the box is
  reserved before the image loads. This fixes real layout shift for
  members too, not only the specs.
- Replace the dead guard with config.x.blank_avatars, which browser specs
  set, making avatar_uri return a blank inline GIF. Helper specs still
  assert the real Gravatar URLs.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* Fix avatar URI logic to prevent layout shift in all environments

---------

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-09-24 13:36:44 +09:30
..
2026-09-20 20:20:51 +12:00
2026-04-24 00:15:18 +09:30
2019-12-26 13:38:17 +13:00
2024-01-07 01:57:19 +00:00