Christopher Bailey
2008-Dec-05 19:21 UTC
[rspec-users] View tests and fragment caching issue
I hope I''m just missing something obvious here, but I am using fragment caching in a partial for a view. I test this view with an RSpec view test. The particular test is using "real" data (i.e. not mocked objects, etc.). When I run the test, it complains about not knowing of a route for the fragment. The fragment parameter should be that though, a query param, not part of a path, etc. Anyway, here''s what I see for the error: No route matches {:action=>"index", :fragment=>"similar_deals"} The partial has the following caching line in it: <% cache({:fragment => ''similar_deals''}, :expires_in => 24.hours) do %> Can someone point me in the right direction for how to deal with this? -- Christopher Bailey Cobalt Edge LLC http://cobaltedge.com -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/rspec-users/attachments/20081205/34eedc95/attachment-0001.html>
On Fri, Dec 5, 2008 at 1:21 PM, Christopher Bailey <chris at cobaltedge.com> wrote:> I hope I''m just missing something obvious here, but I am using fragment > caching in a partial for a view. I test this view with an RSpec view test. > The particular test is using "real" data (i.e. not mocked objects, etc.). > When I run the test, it complains about not knowing of a route for the > fragment. The fragment parameter should be that though, a query param, not > part of a path, etc. Anyway, here''s what I see for the error: > No route matches {:action=>"index", :fragment=>"similar_deals"} > The partial has the following caching line in it: > <% cache({:fragment => ''similar_deals''}, :expires_in => 24.hours) do %> > Can someone point me in the right direction for how to deal with this?Seems like this is a deficiency in rspec-rails. Would you mind posting this to http://rspec.lighthouseapp.com? Thx> -- > Christopher Bailey > Cobalt Edge LLC > http://cobaltedge.com > > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users >