Sha256: cbdf28103ce4f955ff91172e387a470773ad79ffba063b565b62c9a0703ac91d
Contents?: true
Size: 1.71 KB
Versions: 4
Compression:
Stored size: 1.71 KB
Contents
require "#{File.dirname __FILE__}/helper" class TestLayout < Test::Unit::TestCase def test_layout_list with_test_site do |site| assert_not_nil site.layouts assert_equal 2, site.layouts.length assert_equal [ :default, :post ], site.layouts.keys.sort { |l,r| l.to_s <=> r.to_s } assert_not_nil site.layouts[:default] assert_not_nil site.layouts[:post] end end class Page def title; 'Layout Test'; end end def test_default_layout with_test_site do |site| src = '<p>Hello World!</p>' layout = site.layouts[:default] assert_render_equal_ref 'test_layout/default_layout.html', layout, { :content => src, :page => Page.new }, { :right => 'default.html' } end end class Post def id; 314159; end def title; "Test Post"; end def uri; "/2009/01/13/test-post.html"; end def permalink; "/2009/01/13/test-post.html"; end def comments_link; "#{uri}#comments"; end def author; "Josh Dady"; end def created; Time.local(2009, 1, 13); end def time?; true; end def time; "11:52 AM"; end def tags; []; end def comments_link; "#{permalink}##comments"; end def comment_count; 0; end end def test_post_layout with_test_site do |site| src = '<p>Hello World!</p>' layout = site.layouts[:post] assert_render_equal_ref 'test_layout/post_layout.html', layout, { :content => src, :page => Post.new }, { :right => 'post.html' } end end end
Version data entries
4 entries across 4 versions & 1 rubygems
Version | Path |
---|---|
zzot-semi-static-0.0.3 | test/test_layout.rb |
zzot-semi-static-0.0.4 | test/test_layout.rb |
zzot-semi-static-0.0.5 | test/test_layout.rb |
zzot-semi-static-0.0.6 | test/test_layout.rb |