[rspec-users] problems matching generated html output...

2011-11-03 Thread Patrick J. Collins
So, I am writing tests for a presenter class that outputs html markup. I have a method that does something like this: def output things.map do |thing| content_tag :div, :id => thing[:id] do [content_tag :p, thing[:body_1], content_tag :p, thing[:body_2].join.ht

Re: [rspec-users] problems matching generated html output...

2011-11-03 Thread Matt Wynne
On 3 Nov 2011, at 22:36, Patrick J. Collins wrote: > So, I am writing tests for a presenter class that outputs html markup. > > I have a method that does something like this: > > def output > > things.map do |thing| > >content_tag :div, :id => thing[:id] do > [content_tag :p, th

Re: [rspec-users] problems matching generated html output...

2011-11-03 Thread Patrick J. Collins
> I realise this isn't the answer you're looking for, but I'm curious: where > did you get the idea that a presenter should know anything about HTML? Maybe I am using the wrong terminology then. I always thought presenters were classes that output presentational content... If you have a view wit

Re: [rspec-users] problems matching generated html output...

2011-11-03 Thread Patrick J. Collins
> So, I am writing tests for a presenter class that outputs html markup. > Actually now that I am thinking about it.. Would you guys recommend that I use something like Nokogiri to parse the content and test for things like number of children, classes, ids, etc, rather than just comparing the raw

Re: [rspec-users] problems matching generated html output...

2011-11-03 Thread Pat Maddox
On Nov 3, 2011, at 4:07 PM, Patrick J. Collins wrote: >> So, I am writing tests for a presenter class that outputs html markup. >> > Actually now that I am thinking about it.. Would you guys recommend that I > use > something like Nokogiri to parse the content and test for things like number >