Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Document the failure around Haml caching as a spec
  • Loading branch information
manveru committed Feb 2, 2010
1 parent d931221 commit ba832e9
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions spec/ramaze/view/haml.rb
Expand Up @@ -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

Expand Down Expand Up @@ -83,4 +99,16 @@ def sum(num1, num2)
3
</div>"
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

0 comments on commit ba832e9

Please sign in to comment.