Skip to content

Instantly share code, notes, and snippets.

@valdemarua
Last active May 3, 2024 14:13
Show Gist options
  • Save valdemarua/713f49b7daf9267c7a076082f3b22556 to your computer and use it in GitHub Desktop.
Save valdemarua/713f49b7daf9267c7a076082f3b22556 to your computer and use it in GitHub Desktop.
New Rails App Settings
– Generate new app:
– Add Standardrb/Rubocop
– Tune generators
# application.rb
config.generators do |g|
g.javascripts false
g.stylesheets false
g.helper false
g.request_specs true
g.routing_specs false
g.view_specs false
g.system_tests nil
g.template_engine :erb # views will not be generated when set to false
g.test_framework :rspec
end
– Add pry gem
# Testing
– Add rspec-rails
– Add factory-bot
NOTE: rspec-rails should be loaded before factory-bot so that generators will work properly with rspec:
```
group :development, :test do
gem 'rspec-rails'
gem 'factory_bot_rails'
end
```
– Add shoulda-matchers
# spec/support/shoulda_matchers.rb
Shoulda::Matchers.configure do |config|
config.integrate do |with|
with.test_framework :rspec
with.library :rails
end
end
– Add devise
For API Application
- Add jsonapi_errors_handler gem – https://github.com/driggl/jsonapi_errors_handler
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment