I do not mean to answer a question with another question but why test
your partial? It should be written in such a reusable way that the
code should be near bullet proof. If you also follow the partial sans-
logic approach than there would be no reason to test a partial other
than to create 'artificial code coverage' with a brittle test.
Now to answer your question, the best approach would be to render the
partial within the scope that it will be used. Isolated testing only
makes sense if your doing particular logic inside the partial which
you shouldnt be in the first place. So just check
@response.body.should include("the thingy") or better yet
@response.body should have_xpath(//@id=...)
On Jan 23, 8:46 pm, Phlip <[email protected]> wrote:
> Merbalists:
>
> This will save me a bit of research if I know the destination. Within Merb's
> concept of a view test, how to I whip out only one partial and render it into
> @response.body?
>
> The point is to isolate the test target. Testing a partial thru an entire
> controller action and its page output is your basic raincoat-in-the-shower
> situation...
>
> --
> Phlip
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"merb" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [email protected]
For more options, visit this group at http://groups.google.com/group/merb?hl=en
-~----------~----~----~----~------~----~------~--~---