agoragames/stache — pull request #31 by kianw (2013-11-20 07:24:40+00:00)
Title: Access RSpec-assigned instance variables in view classes

This was the major thing holding me back from being able to write view specs in RSpec. There appeared to be no way to assign an instance variable and have stache give the view class access to it. It works fine in development and production, as controller instance variables are copied into the local context. But RSpec copies / assigns the instance variables into the view object. This code copies the view's instance variables into the mustache context in addition to the controller's instance variables. Now we can write view specs for stache templates!