# Copyright (c) 2006 Michael Fellinger m.fellinger@gmail.com # All files in this distribution are subject to the terms of the Ruby license. require 'spec/helper' spec_require 'ramaze/template/haml' class TCTemplateHamlController < Ramaze::Controller map :/ view_root __DIR__/:haml engine :Haml helper :link def index end def with_vars @title = "Teen Wolf" end end class TCRamazeLocals < Ramaze::Controller map '/locals' view_root __DIR__/:haml def output render_template 'locals.haml', :abc => 'def' end private def sayhi 'hi' end end describe "Haml templates" do behaves_like 'http' ramaze(:compile => true) it "should render" do get('/').body.strip.should == %{

Eugene Mumbai

} end it "should have access to variables defined in controller" do get('/with_vars').body.strip.should == %{

Teen Wolf

Home
} end it 'should support locals via render_template' do get('/locals/output').body.strip.should == "def\nhi" end end