Skip to content

Instantly share code, notes, and snippets.

@capitalist
Created December 22, 2010 21:38
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save capitalist/752143 to your computer and use it in GitHub Desktop.
Save capitalist/752143 to your computer and use it in GitHub Desktop.
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