On 1/2/07, Ed Howland <ed.howland at gmail.com>
wrote:>
> Hi, all.
>
> I have some controller tests in (using rspec) How do I test them with
> Masterview?
>
> If I try to test that the correct partial is rendered, this fails
> because the requested file doesn''t exist. (The .html is there, but
not
> the MV generated .rthml)
>
> Do I need to test only with Rake?
I''ll have to look into that Ed. I think it most likely has to do with
the
logic that tries to determine the mode in which MasterView is supposed to
run. For instance when running in a server additional code is executed than
when running other commands.
The work around is to switch the environment setting to generate the rhtml
rather than load it directly. Then after you have generated it (either by
starting a server or using the rake command do do it) then you can run all
your tests normally because the rhtml will be there (along with the html).
There are no issues with running this way except that your file system gets
a little cluttered with these generated files, which is one of the reasons
we made the feature to load the erb directly. Also if you decide to switch
back to non-generated you have to manually clean up the old files.
So hopefully the work around will solve your immediate need while I look
into a longer term fix which is a little tricky because of the reasons I
mentioned. We also probably need an easy way to clean up generated files and
some way to easily switch back and forth.
Jeff
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
http://rubyforge.org/pipermail/masterview-users/attachments/20070102/cb0325ba/attachment.html