Comments on: rails 2 day 4: rcov and more behavior-driven development /2008/12/rails-2-day-4-rcov-and-more-behavior-driven-development/ Sarah Allen's reflections on internet software and other topics Wed, 03 Mar 2010 22:59:42 +0000 hourly 1 https://wordpress.org/?v=5.7.1 By: Cucumber and RSpec resources | Codesennin /2008/12/rails-2-day-4-rcov-and-more-behavior-driven-development/#comment-357 Wed, 03 Mar 2010 22:59:42 +0000 /sarahblog/2008/12/rails-2-day-4-rcov-and-more-behavior-driven-development/#comment-357 […] rcov and more behavior-driven development […]

]]>
By: markiv /2008/12/rails-2-day-4-rcov-and-more-behavior-driven-development/#comment-356 Sat, 17 Oct 2009 01:06:25 +0000 /sarahblog/2008/12/rails-2-day-4-rcov-and-more-behavior-driven-development/#comment-356 Thanks for the great post….

]]>
By: Ansgar /2008/12/rails-2-day-4-rcov-and-more-behavior-driven-development/#comment-355 Fri, 06 Feb 2009 12:58:29 +0000 /sarahblog/2008/12/rails-2-day-4-rcov-and-more-behavior-driven-development/#comment-355 Hi Sarah,
thank you for this tutorial.

One note to the last refactoring (respond_to block).
This block is there to return the data in the requested format. So
format.html returns the web page as we know it and
format.xml returns the data in xml format (try http://localhost:3000/tasks.xml).

Ansgar

]]>
By: Paul /2008/12/rails-2-day-4-rcov-and-more-behavior-driven-development/#comment-354 Tue, 20 Jan 2009 06:25:44 +0000 /sarahblog/2008/12/rails-2-day-4-rcov-and-more-behavior-driven-development/#comment-354 Hi.
This is a great post. I have a couple small suggestions:

change this <tr id="<%="task"+task.id.to_s%>">
to this <tr id="<%= dom_id(task) %>">

That will produce output like task_1, task_2, etc. That’s just a bit more of a “Rails” way to do it.

Then in your matcher, you could change this within("table > tr#task"+task.id.to_s) do
to this within("table > tr#task_#{task.id}") do

Or you could include ActionView::Helpers::RecordIdentificationHelper and then change it to this within("table > tr##{dom_id task}") do

Cheers

]]>