Sha256: 790cefe567ba3d5e8767fd46e045687146c10d71f5ae5c47a42db92ed81289e7

Contents?: true

Size: 551 Bytes

Versions: 2

Compression:

Stored size: 551 Bytes

Contents

require File.dirname(__FILE__) + '/helper'

class ContentForTest < Test::Unit::TestCase
  include Liquor
  
  def test_content_for
    layout_template = '<title>{% yield title %}</title> <body>{% yield %}</body>'
    view_template = '{% content_for title %}{% assign text="aaa" %}{{ text }}{% end_content_for %}{% assign text="body" %}{{ text }}'
    
    rendered_template = Template.parse(view_template).render({ :layout => Template.parse(layout_template) })
    
    assert_equal '<title>aaa</title> <body>body</body>', rendered_template
  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
liquor-0.1.1 test/content_for_test.rb
liquor-0.1.0 test/content_for_test.rb