Access RSpec-assigned instance variables in view classes #31

Merged
merged 3 commits into from Jan 13, 2014

Projects

None yet

2 participants

@kianw
Contributor
kianw commented Nov 20, 2013

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!

@czarneckid czarneckid merged commit 17d5231 into agoragames:master Jan 13, 2014

1 check passed

default The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment