Sha256: 5aab967ba886a7d03bc96b0efdabe3fd48303e0863fae36aa76db63fdeab3b78

Contents?: true

Size: 962 Bytes

Versions: 6

Compression:

Stored size: 962 Bytes

Contents

#!/usr/bin/env ruby

require 'test/unit'
currentPath = File.dirname(__FILE__)
require File.join( currentPath, '../../lib/masterview' )
require File.join( currentPath, '../../lib/masterview/directives/link_to_if')

class TestLinkToIf < Test::Unit::TestCase
  include MasterView::Directives

  def setup
    @directives = MasterView::DirectiveSet.new
  end

  def test_previous
    tag = MasterView::Tag.new(@directives, 'foo', {}, :normal, nil)
    @directives.directives = []
    attr_value = "@product_pages.current.previous, {:page => @product_pages.current.previous }"
    @directives << Link_to_if.new(attr_value)
    assert_equal nil, @directives.determine_dcs(:stag).render
    dcs = @directives.determine_dcs(:etag)
    dcs.context = tag.create_context
    dcs.context[:tag].content = "Previous page"
    assert_equal "<%= link_to_if @product_pages.current.previous, 'Previous page', {:page => @product_pages.current.previous } %>", dcs.render
  end

end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
masterview-0.2.0 test/unit/directive_link_to_if_test.rb
masterview-0.2.1 test/unit/directive_link_to_if_test.rb
masterview-0.2.3 test/unit/directive_link_to_if_test.rb
masterview-0.2.2 test/unit/directive_link_to_if_test.rb
masterview-0.2.4 test/unit/directive_link_to_if_test.rb
masterview-0.2.5 test/unit/directive_link_to_if_test.rb