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
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
> 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
> 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
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
>