New Rails Project Best Practices
March 3rd, 2010Every now and again, our team creates a new Rails app.
The last time we did this, we had a discussion about how we could make our new Rails app easier to maintain and test, as well as reducing the duplication across multiple Rails apps.
Here’s the list of recommendations we came up with:
Cucumber Feature Tests
- Don’t change generated step definition files (e.g. web_steps.rb from webrat), instead add new steps to new files.
- Extract common steps (ones used in more than one project) to a template
WebMock
Template
- Use a template for common stuff such as Capistrano Tasks, Rake Tasks, Scripts and Cucumber Step Definitions – as well as the usual initial project setup
Configuration
- Instead of using constants in production.rb, use a configuration class.
Continuous Integration
- Have tests that test installing from scratch
- Have tests that test upgrades
- Have a test that uses the latest versions of gems
(you can never have too many tests).
Deployment
- Use git-deploy instead of just capistrano – it’s faster, easier, and uses the power of git
REST
- Use Restfulie
Posted in Uncategorized | | Top Of Page