Repository navigation
Add a dummy app, specs and CI; fix form auto-init on jQuery 3 - #9
Merged
Merged
Conversation
The gem shipped with no tests at all, so every change to the JS was verified by hand. Add the harness the sibling plugins use: a Rails app generated on demand by spec/support/rails_template.rb into the gitignored spec/rails/rails-<version>/, driven through headless Chrome by cuprite. The dummy app pins config.eager_load in the test environment. The generated default only eager loads when CI is set, and without it Zeitwerk drops Active Admin's own constants during boot, which fails the index page long before any of this gem's code runs. Covers the date_range filter path: the "Set range" link, the popup, each preset's dates, dismissal by an outside click, and that the chosen range actually filters the collection. The bundler "~> 1.8" development dependency goes: it cannot resolve against the bundler that ships with any supported Ruby.
$(document).on('ready') was removed in jQuery 3.0, and Active Admin 3.x
ships jQuery 3. The handler never fired, so every input pair marked with
the documented `wrapper_html: { class: 'datetime_preset_pair' }` was
silently left without its "Set range" link. Only the filter path, wired
by hand in the host app, still worked.
Switch to $(fn), which jQuery has always supported, and fix the README
snippets that told readers to use the removed form.
Ruby 3.2-3.4 against Rails 7.1, 7.2 and 8.0, each with Active Admin 3.2 and 3.5. Rails 8 has no 3.2-compatible release, so that pair is excluded.
Fivell
force-pushed
the
feature/dummy-app-and-ci
branch
from
September 30, 2026 20:54
30eacbf to
c605feb
Compare
This was referenced Oct 1, 2026
The suite's first visit compiles active_admin.scss and the JS bundle, which outruns Ferrum's 5s default response timeout on a loaded runner. A leg died with Ferrum::TimeoutError on the very first example; every later request is served from the Sprockets cache and is nowhere near the limit.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The gem had no tests and no CI, so a regression could only be caught by a user. Writing the first suite found one.
Test harness
A throwaway Rails app, generated on demand by
spec/support/rails_template.rbinto the gitignoredspec/rails/rails-<version>/— the same pattern the sibling plugins use. Driven through headless Chrome by cuprite.The dummy app pins
config.eager_loadin the test environment. The generated default only eager loads whenCIis set, and without it Zeitwerk drops Active Admin's own constants during boot, which fails the index page long before any of this gem's code runs. Pinning it keeps a local run and a CI run on the same footing.10 examples covering both entry points: the
date_rangefilter (the "Set range" link, the popup, each preset's dates, dismissal by an outside click, and that the chosen range actually filters the collection) and thedatetime_preset_pairauto-init in a form.The bug
$(document).on('ready')was removed in jQuery 3.0, and Active Admin 3.x ships jQuery 3. The auto-init handler never fired, so every input pair marked with the documentedwrapper_html: { class: 'datetime_preset_pair' }was silently left without its "Set range" link. Only the filter path — wired by hand in the host app — still worked. Switched to$(fn), and fixed the README snippets that told readers to use the removed form.Both auto-init specs fail on the parent commit and pass on the fix.
CI
Ruby 3.2-3.4 against Rails 7.1, 7.2 and 8.0, each with Active Admin 3.2 and 3.5. Rails 8 has no 3.2-compatible release, so that pair is excluded. Every corner of the matrix was run locally before pushing.
Also
bundler "~> 1.8"development dependency — it cannot resolve against the bundler that ships with any supported Ruby, sobundle installfailed outright.