Displaying 1 result from an estimated 1 matches for "display_flash".
2008 Jul 03
0
Testing HAML in helper rspec
...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, :error]
if flash[name]...