Created
December 22, 2010 21:38
-
-
Save capitalist/752143 to your computer and use it in GitHub Desktop.
View specs for controllers that use decent_exposure
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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