diff --git a/spec/ramaze/view/haml.rb b/spec/ramaze/view/haml.rb index 5a8b2be3..c0c54e28 100644 --- a/spec/ramaze/view/haml.rb +++ b/spec/ramaze/view/haml.rb @@ -31,6 +31,22 @@ def sum(num1, num2) end end +class SpecHamlLayout < Ramaze::Controller + map '/with_layout' + engine :Haml + layout :wrapper + + RUNS = [1,2,3] + + def index + RUNS.shift.to_s + end + + def wrapper + '= @content' + end +end + describe Ramaze::View::Haml do behaves_like :rack_test @@ -83,4 +99,16 @@ def sum(num1, num2) 3 " end + + should 'render the wrapped view twice even with caching' do + got = get('/with_layout') + got.status.should == 200 + got['Content-Type'].should == 'text/html' + got.body.strip.should == "1" + + got = get('/with_layout') + got.status.should == 200 + got['Content-Type'].should == 'text/html' + got.body.strip.should == "2" + end end