Displaying 1 result from an estimated 1 matches for "init_haml_help".
2008 Jul 03
0
Testing HAML in helper rspec
...an find it.
Thanks to David for the pointers to solve this.
Here is the incantation needed to use HAML 2.0 under RSpec 1.1.5 (Needs the .5 for a fix)
# application_helper_spec.rb under spec/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*#...