Sha256: 50b3657f29cbd38b5d320113d9586723faf560dc3d02fca83a708ee7f1353dac
Contents?: true
Size: 1005 Bytes
Versions: 1
Compression:
Stored size: 1005 Bytes
Contents
require 'test_helper' class SteeringRailsTest < ActiveSupport::TestCase FIXTURE_ROOT = File.expand_path('../fixtures', __FILE__) def fixture_path(path) File.join(FIXTURE_ROOT, path) end def render(path) Steering::Rails::Template.new(fixture_path(path)).render end def test_template expected = <<-EOF Handlebars.template(function (Handlebars,depth0,helpers,partials,data) { this.compilerInfo = [4,'>= 1.0.0']; helpers = this.merge(helpers, Handlebars.helpers); data = data || {}; var buffer = "", stack1, helper, functionType="function", escapeExpression=this.escapeExpression; buffer += "Hello "; if (helper = helpers.name) { stack1 = helper.call(depth0, {hash:{},data:data}); } else { helper = (depth0 && depth0.name); stack1 = typeof helper === functionType ? helper.call(depth0, {hash:{},data:data}) : helper; } buffer += escapeExpression(stack1) + "\\n"; return buffer; }) EOF assert_equal expected.strip, render('hello.jst.handlebars') end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
steering-rails-1.3.0 | test/steering_rails_test.rb |