Kristian Mandrup
unread,Aug 25, 2010, 11:44:34 AM8/25/10Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Sign in to report message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Ruby on Rails: Talk
Hi,
I am trying to write an RSpec 2 extension, which lets me test my
templating view logic standalone without loading the "full rails",
including controller, routes etc. etc.
I simply want to be able to take a String in the form of a valid ERB
template and render it, where the @outputbuffer is on (for delayed
handling of blocks), and then set any values in the view context and
extend it with whatever helper modules that suit the particular
context.
The ActionView::TestCase, is a bit too "heavy" (includes too much
outside of basic view functionality), so I have been looking at
ActionView::Template.
The #render method takes arguments view and a locals, which I think is
a Hash.
Is this what I should be aiming to use? Any examples of this kind of
usage outside Rails?
Kristian