• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

MushroomObserver / mushroom-observer / 27492485378
98%
main: 98%

Build:
Build:
LAST BUILD BRANCH: njw-close-coverage-gaps
DEFAULT BRANCH: main
Ran 14 Jun 2026 07:58AM UTC
Jobs 1
Files 1539
Run time 2min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

14 Jun 2026 07:53AM UTC coverage: 97.693%. Remained the same
27492485378

Pull #4524

github

nimmolo
test: sweep `assert_template` -> stable element / body-class assertions

`assert_template` only works for ERB partials — Phlex components and
action templates render outside ActionView's template-lookup chain,
so any future Phlex conversion silently turns these assertions into
no-ops. Replace every active call site with a CSS-selector check
against a stable identifier on the rendered DOM.

Substitution patterns:

- `assert_template(:action)` / `("action")` /
  `("controller/action")` -> `assert_select("body.<controller>__<action>")`
  using the per-action body class stamped by `application.html.erb`
  (`controller_name__action_name`, with `create -> new` /
  `update -> edit`).
- Partials with a stable wrapper id -> assert the id:
  `_notes` -> `#location_notes`, `_general_description_panel` ->
  `#location_general_description`, `_help` ->
  `#locations_search_help` (id added to the partial in this PR).
- Modal turbo_stream partials -> assert the turbo-stream action:
  `_modal_flash_update` ->
  `turbo-stream[action='update'][target$='_flash']`,
  `_modal_form_reload` ->
  `turbo-stream[action='replace'][target$='_form']`,
  `herbaria/_update_observation` ->
  `turbo-stream[action='remove'][target='modal_herbarium']`.
- Confirmation pages / explicit `render(:other_template)` paths where
  the body class won't match the rendered template (`render(:confirm)`
  from `create`, `render('images/show')` from `update`) -> assert a
  stable element id on the rendered page (`#estimated_count`,
  `#image_votes_container`, `[data-controller='inat-import-job']`).
- `rss_logs#rss` is an XML feed (`render_xml(layout: false)`) with no
  body element -> `assert_response(:success)`.
- `Locations::VersionsControllerTest#test_show_past_location` was
  already asserting nothing useful (`_notes` is wrapped in
  `unless @location.notes.blank?`); the body-class check above the
  removed line is sufficient.

Other changes:

- `test/controller_extensions.rb`: `assert_response(S... (continued)
Pull Request #4524: test: sweep assert_template → stable element / body-class assertions

46756 of 47860 relevant lines covered (97.69%)

701.8 hits per line

Jobs
ID Job ID Ran Files Coverage
1 27492485378.1 14 Jun 2026 07:58AM UTC 1539
97.69
GitHub Action Run
Source Files on build 27492485378
  • Tree
  • List 1539
  • Changed 0
  • Source Changed 0
  • Coverage Changed 0
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #27492485378
  • Pull Request #4524
  • PR Base - main (#27479756768)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc