Displaying 1 result from an estimated 1 matches for "block_render_except".
2008 May 08
0
stub sub partials when testing partial with rspec
...test partial with sub partials I
have a problem.
if I stub render, then my partial will not be rendered. If i do not
stub render it tries to render sub partial (and i don''t need this)
Not very long googling did not bring the answer, so I made very dirty
and IMHO dangerous function
def block_render_except unblocked
ActionView::Partials.class_eval do
public
def self.set_unblocked partial
@@unblocked = partial
end
alias_method :orig_render_partial,:render_partial
def render_partial(partial_path, object_assigns = nil,
local_assigns = nil) #:nodoc:
if...