Skip to content

Add the step pack for Ruby on Rails apps (8.1 and 8.0) - #2

Merged
Natshah merged 3 commits into
2.0.xfrom
1-rails-steps
Dec 4, 2026
Merged

Natshah merged 3 commits into
2.0.xfrom
1-rails-steps

Conversation

@Natshah

@Natshah Natshah commented Dec 4, 2026

Copy link
Copy Markdown
Member

Adds the step pack for Ruby on Rails apps, @webship-js/rails-steps 2.0.0.

Issue: #1

What it brings

  • 22 step definitions on "the web application", in three files (session, resources, app), each with five examples. No phrase names the platform, and none is shared with the 71 published packs or the Jellyfin, Meilisearch, Express, Superset, Flask, Vaultwarden and Gitea packs ("the web app" is Flask's).
  • Users through the app's console (bin/rails runner -, the Ruby on its input), so no back door is needed and no secret is on a command line. Users get a random in-memory password and are removed with their sessions at the scenario's end; the records a scenario made are removed the same way. The README says which steps need the console.
  • Turbo-aware waits: every form step waits on the app's answer and the address, never on load state. The destroy confirm is answered (confirm or cancel). A refused form's 422 console line is allowed only in its own step, for that path and status.
  • Cookies by scheme: HttpOnly, SameSite Lax, and Secure exactly on https.
  • The password reset is read from Mailpit's API (never the log) and used once. The token in /passwords/<token>/edit is masked in every failure, including webship-js's own Page: line, and in webship-js's error list (Secrets in a URL's query leak through the JavaScript-error report webship-js#707 now also covers paths).

The demo (demo/rails-demo-app.sh, made at the build, nothing of rails new ships)

Rails line Ruby Image
8.1.4.1 4.0.10 docker.io/library/ruby@sha256:5ac6b9f959a3356af5fc4f6a80a30106d99fd51785633f8a365be73cbe84e199
8.0.5.2 4.0.10 the same (Ruby 3.4.13 could not be built: Debian's mirror stalled, twice)
  • Generated: rails new, a notes scaffold, and the authentication generator.
  • Our additions: the root route, a title validation, a Sign out button, the destroy confirm, the mailer host, SMTP to Mailpit, secret_key_base from a 0600 file, and three made-up notes.
  • Secure cookies on https only, through a small middleware. force_ssl made the session cookie Secure on every request, so plain http kept no session and every form failed its CSRF check; the curl proof is in the README.
  • The sign-in rate limit comes from SIGN_IN_RATE_LIMIT (the generator's 10 by default; 500 only in this demo and the workspace's development build, as the README says).
  • Runs in development: the error-page step needs it and is tagged @development.

Proof (local, the demo on Docker, under the router lock)

Line Suite run 1 Suite run 2 Must-fail Memory peak (512 MB cap)
8.1.4.1 7/7 scenarios, 42/42 steps 7/7, 42/42 11/11, no secret, trace or HAR 217 MiB
8.0.5.2 7/7, 42/42 7/7, 42/42 (and again after the noun change) 11/11, no secret, trace or HAR 266 MiB

journalctl -k: no OOM. npm run test:examples (22 definitions, 110 examples), npm run test:paths and cucumber-js --dry-run pass.

Trademark

The logo is Simple Icons' rubyonrails icon, unmodified, used only to say the pack supports Ruby on Rails, as rubyonrails.org/trademarks allows. The disclaimer is at the bottom of the README.

Checkpoints

  • File an issue about this project
  • Addition/Change/Update/Fix to this project
  • Testing to ensure no regression
  • Automated unit/functional testing coverage
  • Developer Documentation support on feature change/addition
  • User Guide Documentation support on feature change/addition
  • Accessibility and Readability
  • Reviewed by a human
  • Code review by maintainers
  • Full testing and approval
  • Credit contributors
  • Review with the product owner
  • Update Release Notes
  • Release

🤖 Generated with Claude Code

Natshah and others added 3 commits December 4, 2026 20:00
22 steps on "the web application": users through the app's console,
signing in and out, a scaffold's resources with Turbo's confirm and their
errors, notices, cookie flags by scheme, CSRF and health checks, a
password reset read from the mail catcher, the development error page,
and no request outside its address. The demo app is made at the build;
every secret is kept out of messages, failures and reports.

Fixes #1

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The demo refuses a secret shorter than 64 characters, as a real
secret_key_base is: openssl rand -hex 64, as bin/rails secret makes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
RUBY_VERSION is in the official Ruby image's environment, not in every
image the script runs in (DDEV's web container, where the Workspace's
plugin makes the app): under set -u its last line failed the whole make.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Natshah
Natshah merged commit 915cbb0 into 2.0.x Dec 4, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant