Introducing ModelMocker
While writing Rails apps, I've written several variants on the 'give me an ActiveRecord instance that can't talk to the DB' theme over the last couple of years while writing tests or specs for an app. The basic pattern is a pretty good one - it guarantees you a certain degree of test isolation for your unit tests or specs, when you need it. And, because you're make specific instances isolated, you can get to the DB if you need to.
- 12.12.2008, 19.58
- File under: Ruby, Rails, Ruby on Rails, RSpec, Mocha, Mock objects, testing, development, ModelMocker, Test-driven development, Behaviour-driven development
Setting up a more-integrated Selenium, Cucumber, and Rails
I've been using [Selenium] [1] and [Cucumber] [2] together for a few months now, and I've really enjoyed being able to actually test the Ajaxy parts of my apps. The initial setup was a bit of a pain, and most of the tutorials I found advocated completely separate and parallel Selenium and non-Selenium Cucumber feature directories. I didn't want this, worked out a more integrated way, which changes to Cucumber have since allowed me to make even more straightforward. I'm going to assume you want to set up Selenium with Cucumber, or want to improve your setup, rather than introduce either thing.