[rspec-users] RSpec 2 view specs: partial mocks
michael at schuerig.de
Tue Jun 22 09:27:09 EDT 2010
On Sunday 20 June 2010, Michael Schuerig wrote:
> Are partial mocks supposed to work in rails-rspec 2.0.0.beta.12?
> I'm trying to do things like
> However, when I do that, the view uses its "ordinary" functionality,
> in particular, assigns are no longer available as instance
I've found the reason:
@_view ||= begin
view = ActionView::Base.new(ActionController::Base.view_paths,
#_view (and #view in turn) creates just one ActionView::Base instance
the first time it is called. That's as it is intended. The effect is,
however, that only assigns up to that point are passed to that instance.
Consequently, later assigns are ignored.
mailto:michael at schuerig.de
More information about the rspec-users