search for: capture_haml

Displaying 1 result from an estimated 1 matches for "capture_haml".

2008 Jul 03
0
Testing HAML in helper rspec
...c/helpers ... before :each do helper.extend Haml helper.extend Haml::Helpers helper.send :init_haml_helpers end it "should display flash" do for name in [:notice, :warning, :error] flash[name]= "flash #{name.to_s} message" helper.capture_haml{ helper.display_flash }.should match(/<div class=''#{name.to_s}''>\s*#{flash[name]}\s*<\/div>/) flash[name]= nil end end ... Which tests this in application_helpers.rb def display_flash for name in [:notice, :warning, :erro...