Testing partials

Guys,

How can we test partials and layouts… ? Googled but find nothing
useful…

On Tue, Apr 13, 2010 at 5:06 AM, Hemant B. [email protected]
wrote:

Guys,

How can we test partials and layouts… ? Googled but find nothing
useful…

In the same way you test your views. You can use Selenium if you like.
I don’t like the use of Selenium for this, I prefer to test the views
contain the text that should be there and delegate the full testing of
the view to a human tester. (Probably myself, but can be other people
if you have a test team)

Hope it helps.


Leonardo M…
There’s no place like ~

Hi Leonardo,

I am not using any tool for tesing. Neither i want to…

Leonardo M. wrote:


In the same way you test your views. You can use Selenium if you like.
I don’t like the use of Selenium for this, I prefer to test the views
contain the text that should be there and delegate the full testing of
the view to a human tester. (Probably myself, but can be other people
if you have a test team)

Hope it helps.


Leonardo M…
There’s no place like ~

On Tue, Apr 13, 2010 at 11:33 AM, Hemant B. [email protected]
wrote:

Hi Leonardo,

I am not using any tool for tesing. Neither i want to…
So, you’re asking how to test your views, and you don’t want to use
any tool for testing?
I assume you have your reasons for not doing any testing, but if you
don’t want to use any tool, you’ll have to test them by hand.


Leonardo M…
There’s no place like ~

If you are using functional tests, then just use assert_select to verify
that the HTML that the partial generates is somewhere in the response.
For
example, if you have a partial that prints out “

hello
”, test
a
controller that has a view that calls that partial, and then do

assert_select “div”, “hello”

then you’ll know the partial worked.