Last active
May 3, 2024 14:13
-
-
Save valdemarua/713f49b7daf9267c7a076082f3b22556 to your computer and use it in GitHub Desktop.
New Rails App Settings
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
– 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