Search
Categories
- Deployment (4)
- Development (63)
- Gems and Plugins (4)
- News (2)
- Projects (4)
- Testing (3)
Most Popular Tags
activerecord architecture collections css database date and time debugging design design patterns DRY ebooks fixtures floating-point numbers formatting framework front page global variables helpers I18n introductory launchpad meta-information migrations model multiplicity mvc MySQL partials production rails 2.0 rails 2.1 Rails 2.2 regular expressions routing rss ruby security setup sql UI upgrading user management validation xml xml builder
Category Archives: Testing
Drilling Down into Validation Failure
Rails provides model-level validation, which is easy and DRY. But if you have a class that validates multiple fields, how can you verify if validation is failing on the right fields? ActiveRecord provides a convenient errors method with an invalid? method you can call; it takes a field name. Continue reading
Foxy Fixtures Explained
Rails integrated a plugin called Foxy Fixtures into the core API. How does it work? It allows you to refer to other fixtures by name, instead of by ID (so no more hard-coded IDs). But there’s a gotcha–the IDs are generated automatically, so they’re not 1 or 2 like you might expect (for your first and second fixtures). Continue reading
Testing Rails Applications
In addition to providing you with a testing framework, Rails generates tests when you use scaffolding. You can even write your own tests (beyond these basic ones)–unit, functional, and integration tests. Here, we discuss how to set up the test environment (it requires its own test database), and run the tests. Continue reading