Uses Strong Migrations to catch unsafe migrations in development.
Follows our guidance for managing seed data. Use
db/seeds.rb for data required in all environments, and
development:db:seed for data specific to development environments.
Place idempotent seed data in Development::Seeder.
To load development seed data:
bin/rails development:db:seedTo reset your database and reload seed data:
bin/rails development:db:seed:replantThe replant command truncates all tables and reloads the seed data, providing
a clean slate for development.
The following environment variables are available in production:
APPLICATION_HOST- The domain where your application is hosted (required)ASSET_HOST- CDN or asset host URL (optional)RAILS_MASTER_KEY- Used for decrypting credentials (required)
- Enables strict_loading_by_default.
- Sets strict_loading_mode to
:n_plus_one. - Enables require_master_key.
- Enables raise_on_missing_translations.
- Sets action_dispatch.show_exceptions to
:none.
- Enables raise_on_missing_translations.
- Enables i18n_customize_full_message.
- Enables apply_rubocop_autocorrect_after_generate!.
- Enables sandbox_by_default.
- Sets action_on_strict_loading_violation to
:log.
Uses RSpec and RSpec Rails in favor of the default test suite.
The test suite can be run with bin/rails spec.
Configuration can be found in the following files:
spec/rails_helper.rb
spec/spec_helper.rb
spec/support/action_mailer.rb
spec/support/driver.rb
spec/support/i18n.rb
spec/support/shoulda_matchers.rb
- Uses action_dispatch-testing-integration-capybara to introduce Capybara assertions into Request specs.
- Uses shoulda-matchers for simple one-liner tests for common Rails functionality.
- Uses webmock for stubbing and setting expectations on HTTP requests in Ruby.
Uses FactoryBot as an alternative to Fixtures to help you define
dummy and test data for your test suite. The create, build, and
build_stubbed class methods are directly available to all tests.
Place FactoryBot definitions in spec/factories.rb, at least until it
grows unwieldy. This helps reduce confusion around circular dependencies and
makes it easy to jump between definitions.
Uses capybara_accessibility_audit and capybara_accessible_selectors to encourage and enforce accessibility best practices.
Intercept emails in non-production environments by setting INTERCEPTOR_ADDRESSES.
INTERCEPTOR_ADDRESSES="user_1@example.com,user_2@example.com" bin/rails sConfiguration can be found at config/initializers/email_interceptor.rb.
Interceptor can be found at lib/email_interceptor.rb.
Uses Sidekiq for background job processing.
Configures the test environment to use the inline adapter.
Uses inline_svg for embedding SVG documents into views.
Configuration can be found at config/initializers/inline_svg.rb
- A partial for flash messages is located in
app/views/application/_flashes.html.erb. - A partial for form errors is located in
app/views/application/_form_errors.html.erb. - Sets lang attribute on
<html>element toenviaI18n.local. - Disables Turbo's Prefetch in an effort to reduce unnecessary network requests.