Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
View specs for controllers that use decent_exposure
#in my spec helper
def expose(name, &block)
exhibitionist = Module.new
exhibitionist.send(:define_method, name, &block)
view.extend exhibitionist
end
# in my view spec
describe "dashboard/index.html.haml" do
it 'renders' do
expose(:foo) { 'bar' }
rendered.should contain('bar')
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.