Sha256: 0b20bc401775a60e71dcbc20fa431012872cbf97682d85450ed14b5833a85da3
Contents?: true
Size: 858 Bytes
Versions: 2
Compression:
Stored size: 858 Bytes
Contents
require 'spec/helper' spec_require 'tenjin' class TCTemplateTenjinController < Ramaze::Controller template_root __DIR__/:tenjin engine :Tenjin def index 'Tenjin Index' end def external(num1, num2) @context = { :num1 => num1.to_i, :num2 => num2.to_i } end def internal '<?rb @test = :internal ?>#{@test}' end def escape_html @context = {:html => "<br />"} '#{@html}${@html}' end end describe "Tenjin templates" do behaves_like 'http' ramaze(:mapping => {'/' => TCTemplateTenjinController}) it "index" do get('/').body.should == 'Tenjin Index' end it "external" do get('/external/1/2').body.should == '3' end it "internal" do get('/internal').body.should == "internal" end it "escape html" do get('/escape_html').body.should == "<br /><br />" end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
ramaze-0.3.9 | spec/ramaze/template/tenjin.rb |
ramaze-0.3.9.1 | spec/ramaze/template/tenjin.rb |