This is a basic introduction to integration testing with cucumber. In it, I describe how to use cucumber and rspec to implement a feature in a web application, emphasizing the importance of writing tests before code, which is often referred to as TDD (test-driven development) or BDD (behavior-driven development, a refinement of the original TDD).
Download 146.8 MB
Download (iphone & ipod) 46.9 MB
Introduction to Outside-in Development with Cucumber
Previous post: Creating a Simple Plugin
Next post: Getting started with GitHub












{ 8 comments }
This is a very nice step by step intro to Outside-In with Cucumber. I love how you're showing that Cucumber actually tells you what to do next, and that you're not taking any shortcuts.
I usually use create! instead of create in my step definitions and specs. That will make exceptions bubble up if you have validation errors.
Personally I have started to go very light on the controller and view specs because it is often redundant to and more ceremonial than cucumber features. I mostly use RSpec for ActiveRecord models when I write Rails apps.
Still, I think it's good to have a “recommended” workflow – especially for people who are new to working Outside-In/BDD/TDD.
Thanks Carl!
Thanks for the tips Aslak. There is certainly some duplication between the controller specs and cucumber, so I agree that it might be a good idea to dispense with them altogether. Glad to hear from you!
I've noticed that my RSpec model tests seem to be very useful but my controller and view tests seem very un-DRY.
Great intro to both Cucumber and TDD…nice work Carl!
Really helpful, thank you !
Maybe its because I'm a total newbie, but I lost your around 10 min line. Could you perhaps a little bit more in your next screencast? You start with Cucumber, then you move onto rspec and lose me there.
Excellent intoduction to Cucumber, even to a non-rails Ruby newbie
Ditto.
Comments on this entry are closed.