This document summarizes the updates made to the Rails Accessibility Testing generator templates based on production best practices from Margarita Barvinok's implementation.
The generator templates have been updated to incorporate production-tested best practices that improve CI/CD safety, production deployment safety, and developer experience.
Changes:
- ✅ Changed
accessibility_enableddefault fromtrue→false - ✅ Added comprehensive documentation explaining CI/CD behavior
- ✅ Updated documentation URL to correct GitHub Pages link
- ✅ Added detailed comments explaining when to enable/disable
Impact:
- Prevents accessibility test failures from blocking CI/CD pipelines
- Allows other RSpec tests to pass even if accessibility tests fail
- Gives developers explicit control over when to run accessibility checks
Changes:
- ✅ Added production safety guard:
if defined?(RailsAccessibilityTesting) - ✅ Changed
auto_run_checksdefault fromtrue→false - ✅ Updated documentation URL to correct GitHub Pages link
- ✅ Added
@seetag for better documentation
Impact:
- Prevents errors if gem is not available in production
- Allows gem to be excluded from production bundle
- Gives developers explicit control over automatic checks
- Safe deployment even if gem configuration is present
Changes:
- ✅ Changed RSpec type from
type: :system→type: :accessibility - ✅ Improved error formatting with unified
format_issues_by_filehelper method - ✅ Changed test assertion to use
expect(errors).to be_emptywith formatted message - ✅ Better success message formatting
Impact:
- Proper RSpec integration with accessibility helpers
- Better test organization and filtering
- Cleaner test output
- Improved error messages with better structure
Created comprehensive best practices guide covering:
- Configuration best practices
- CI/CD integration patterns
- Development workflow recommendations
- Production deployment safety
- Real-world usage examples
- ✅
README.md- Added link to Best Practices guide - ✅
GUIDES/continuous_integration.md- Added best practice about disabling by default - ✅
CHANGELOG.md- Documented template updates
- Accessibility tests disabled by default
- Won't block other RSpec tests in CI
- Manual invocation when needed
- Conditional configuration prevents errors
- Safe deployment even without gem
- No production dependencies
- Explicit control over automatic checks
- Manual testing when needed
- Better error formatting
- Improved error messages
- Proper RSpec integration
- Cleaner test output
For existing installations:
-
Update
config/accessibility.yml:accessibility_enabled: false # Add this if not present
-
Update
config/initializers/rails_a11y.rb:if defined?(RailsAccessibilityTesting) RailsAccessibilityTesting.configure do |config| config.auto_run_checks = false # Change from true if needed end end
-
Update
spec/accessibility/all_pages_accessibility_spec.rb:- Change
type: :systemtotype: :accessibility - Update error formatting to use unified helper method
- Change
These improvements are based on production-tested configurations from:
- Margarita Barvinok - Production configuration improvements
- Real-world usage in Rails applications
- Community feedback and testing
- Test generator with
rails generate rails_a11y:install - Verify templates generate correct configuration
- Update existing projects using migration notes above
- Share feedback and improvements
Date: February 2026
Version: Unreleased (will be in next release)