Skip to content

feat(ci): Add generator E2E test infrastructure#3

Merged
ivankuznetsov merged 10 commits intomainfrom
feat/generator-e2e-tests
Jan 20, 2026
Merged

feat(ci): Add generator E2E test infrastructure#3
ivankuznetsov merged 10 commits intomainfrom
feat/generator-e2e-tests

Conversation

@ivankuznetsov
Copy link
Copy Markdown
Owner

Summary

  • Add bin/test_generator script that creates a fresh Rails app, runs the gem's generators, and executes comprehensive E2E tests
  • Add reusable Page Object test templates in test/generator_test_files/ for system, model, and controller tests
  • Add GitHub Actions generator-test job that runs after unit tests pass to validate generators in CI

Changes

CI Pipeline

  • New generator-test job in .github/workflows/ci.yml
  • Installs Rails, Playwright, and runs the full generator validation

Test Infrastructure

  • bin/test_generator - Creates temp Rails app, installs gem, runs generator, copies tests, executes them
  • test/generator_test_files/pages/ - Page Objects for sign in, sign up, password reset, magic link, confirmation, dashboard
  • test/generator_test_files/system/ - E2E tests for authentication, email confirmation, magic link, password reset
  • test/generator_test_files/models/ - User model tests
  • test/generator_test_files/controllers/ - Dashboard and home controller tests

Bug Fix

  • Moved RailsSimpleAuth::Session from lib/ to app/models/ for proper Rails engine autoloading

Test plan

  • All existing gem tests pass (135 tests)
  • RuboCop passes with no offenses
  • CI pipeline runs and generator-test job succeeds
  • Manual run of bin/test_generator creates working app with passing tests

🤖 Generated with Claude Code

Add CI pipeline validation that generators produce working views:

- bin/test_generator script creates fresh Rails app, runs generators,
  and executes comprehensive E2E tests using Capybara Playwright
- Reusable Page Object test templates in test/generator_test_files/
- GitHub Actions generator-test job runs after unit tests pass

Also fixes Session model autoloading by moving from lib/ to app/models/
for proper Rails engine autoloading.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@cursor
Copy link
Copy Markdown

cursor bot commented Jan 20, 2026

PR Summary

Introduces end-to-end validation for generated apps and addresses a model autoloading issue.

  • Generator E2E pipeline: bin/test_generator spins up a fresh Rails app, runs RSA generators, copies reusable Page Object tests (test/generator_test_files/**), and executes Playwright/Capybara tests
  • CI: New generator-test job in .github/workflows/ci.yml (Ruby 3.4, installs Rails + Playwright) triggered after unit tests
  • Local tooling: bin/ci for lint + unit tests; Rakefile excludes generator test templates from gem test suite; .rubocop.yml tweaks and exclusions for generator files
  • Autoloading fix: Moves RailsSimpleAuth::Session to app/models/rails_simple_auth/session.rb and sets belongs_to :user, class_name: RailsSimpleAuth.configuration.user_class_name
  • Styles: Refreshes rails_simple_auth.css template with updated variables, layout, and components
  • Housekeeping: .gitignore, CHANGELOG.md, CONTRIBUTING.md updates

Written by Cursor Bugbot for commit c762986. This will update automatically on new commits. Configure here.

cursor[bot]

This comment was marked as outdated.

ivankuznetsov and others added 8 commits January 20, 2026 09:35
- Add box-sizing: border-box reset for consistent element sizing
- Ensure all form children have consistent 100% width
- Change actions alignment from center to stretch
- Update color palette to modern indigo tones
- Add shadow and typography CSS variables
- Add local CI script (bin/ci) for contributors
- Update CONTRIBUTING.md with local development instructions

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Configure user_class_name via RailsSimpleAuth.configure instead of
  monkey-patching the Session class
- Eliminates method redefinition warnings during test runs
- Add comment about Rails 8.2 deprecation for signed_id_verifier_secret

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The gem path environment variable was only set during bundle install,
causing Rails commands to fail when looking for the gem path.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Rails 8.1's belongs_to class_name option doesn't support lambdas.
Document that users must configure user_class_name before model load.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The generator test was failing because the users table didn't exist.
Added a CreateUsers migration before running the install generator
to ensure users table exists before sessions (which has a foreign key).

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Copy link
Copy Markdown

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

GEM_PATH is a standard Ruby/RubyGems environment variable. Using it
for a custom purpose could interfere with gem resolution. Renamed to
RSA_GEM_PATH to avoid any potential conflicts.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@ivankuznetsov
Copy link
Copy Markdown
Owner Author

Re: GEM_PATH concern - Good catch! Renamed to RSA_GEM_PATH in commit c762986 to avoid conflict with Ruby's standard GEM_PATH environment variable.

@ivankuznetsov ivankuznetsov merged commit a017a71 into main Jan 20, 2026
6 checks passed
@ivankuznetsov ivankuznetsov deleted the feat/generator-e2e-tests branch January 20, 2026 11:22
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