Skip to content

Day: September 6, 2012

Testing your Ruby/Rails 3.x Model with Cucumber

Post Views: 805 So I’m working on a Ruby/Rails development project for a customer, and using TDD/BDD from word “Go”.  The weapon of choice here is Cucumber.  I know some of the more serious code-cutters prefer RSPEC, but I just like the “feel” of Cucumber. Naturally, part of the job includes ensuring that the various Models in the project pass very basic tests, such as if they are defined properly.  In RSPEC, you can use a solid set of tools to do that, but Cucumber is much more “View” centric in the MVC than it is good for peeking at the Models. So, for amusement, I decided I’d work out a simple Feature and Step set that can be used to verify a project Model. The Cucumber Feature…

Leave a Comment