Sha256: 11dcb0288b19eb5e145259ccbbdc121ff977bc7a3982c2bd9ad85bae4173f70b

Contents?: true

Size: 1.3 KB

Versions: 15

Compression:

Stored size: 1.3 KB

Contents

require "#{::File.dirname(__FILE__)}/../../test_helper"

class TestDrConfigure < Test::Unit::TestCase
  context "Rendering of a string" do
    setup do
      @template_string = "Hello <%= name %>"
    end
    should "should have a method called compile_string on the class" do assert Template.respond_to?(:compile_string);end
    should "should return rendered content" do assert Template.compile_string(@template_string, {:name => "bob"}), "Hello bob" end
  end
  context "Rendering of a file" do
    setup do
      @template_file = ::File.dirname(__FILE__) + "/../../fixtures/test_template.erb"
    end
    should "should have a method called compile_file on the class" do assert Template.respond_to?(:compile_file);end
    should "should return rendered content" do assert Template.compile_file(@template_file, {:friends => "bob"}), "Hello bob" end
  end
  context "render_as" do
    setup do
      @template_options = {:render_as => :erb}
    end

    should "should call render with as erb" do
      assert Template.compile_string("Hi <%= world %>", @template_options.merge(:world => "world")), "Hi world"
    end
    should "call render with haml if rendered with haml" do
      # assert Template.compile_string("Hi <%= world %>", @template_options.merge(:render_as => :haml, :world => "world")), nil
    end
  end
  
end

Version data entries

15 entries across 15 versions & 3 rubygems

Version Path
auser-poolparty-1.1.6 test/poolparty/poolparty/template_test.rb
auser-poolparty-1.1.7 test/poolparty/poolparty/template_test.rb
auser-poolparty-1.2.0 test/poolparty/poolparty/template_test.rb
auser-poolparty-1.2.1 test/poolparty/poolparty/template_test.rb
auser-poolparty-1.2.10 test/poolparty/poolparty/template_test.rb
auser-poolparty-1.2.11 test/poolparty/poolparty/template_test.rb
auser-poolparty-1.2.12 test/poolparty/poolparty/template_test.rb
auser-poolparty-1.2.2 test/poolparty/poolparty/template_test.rb
auser-poolparty-1.2.3 test/poolparty/poolparty/template_test.rb
auser-poolparty-1.2.4 test/poolparty/poolparty/template_test.rb
auser-poolparty-1.2.7 test/poolparty/poolparty/template_test.rb
auser-poolparty-1.2.8 test/poolparty/poolparty/template_test.rb
auser-poolparty-1.2.9 test/poolparty/poolparty/template_test.rb
fairchild-poolparty-1.2.12 test/poolparty/poolparty/template_test.rb
poolparty-1.2.2 test/poolparty/poolparty/template_test.rb