Sha256: ad48fd155f07461aadeca8f45ab4d7fe502085ace2a6d8cf482574e3c626b7ab

Contents?: true

Size: 842 Bytes

Versions: 11

Compression:

Stored size: 842 Bytes

Contents

require 'test_helper'

class ExpressTemplatesTest < ActiveSupport::TestCase
  test "we have a module" do
    assert_kind_of Module, ExpressTemplates
  end

  def assigns
    {}
  end

  test "ExpressTemplates.render renders a template" do
    result = ExpressTemplates.render(self) do
      ul {
        li 'one'
        li 'two'
        li 'three'
      }
    end
    assert_equal "<ul>\n  <li>one</li>\n  <li>two</li>\n  <li>three</li>\n</ul>\n", result
  end

  test "ExpressTemplates.render renders a template with local_assigns" do
    class Foo
      def assigns
        {}
      end

      def local_assigns
        {}
      end
    end

    f = Foo.new

    result = ExpressTemplates.render(f) do
      para { 'All your base are belong to us.' }
    end

    assert_equal "<p>All your base are belong to us.</p>\n", result
  end

end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
express_templates-0.11.20 test/express_templates_test.rb
express_templates-0.11.20.rc1 test/express_templates_test.rb
express_templates-0.11.19 test/express_templates_test.rb
express_templates-0.11.18 test/express_templates_test.rb
express_templates-0.11.17 test/express_templates_test.rb
express_templates-0.11.16 test/express_templates_test.rb
express_templates-0.11.16.rc1 test/express_templates_test.rb
express_templates-0.11.15 test/express_templates_test.rb
express_templates-0.11.14 test/express_templates_test.rb
express_templates-0.11.13 test/express_templates_test.rb
express_templates-0.11.11 test/express_templates_test.rb