Welcome to our site!
<%= print_information %>
<%= render :partial => \"sidebar\" %>
require 'spec_helper' module Deface describe HamlConverter do include_context "mock Rails.application" def haml_to_erb(src) haml_engine = Deface::HamlConverter.new(src) haml_engine.render.gsub("\n", "") end describe "convert haml to erb" do it "should hanlde simple tags" do haml_to_erb("%%strong.code#message Hello, World!").should == "Hello, World!" end it "should handle complex tags" do haml_to_erb(%q{#content .left.column %h2 Welcome to our site! %p= print_information .right.column = render :partial => "sidebar"}).should == "
<%= print_information %>
hello
<% end %>" end it "should handle implicitly closed erb silent" do haml_to_erb("- if foo? %p hello ").should == "<% if foo? %>hello
<% end %>" end it "should handle blocks passed to erb loud" do haml_to_erb("= form_for Post.new do |f| %p = f.text_field :name").should == "<%= form_for Post.new do |f| %><%= f.text_field :name %>
<% end %>" end it "should handle blocks passed to erb silent" do haml_to_erb("- @posts.each do |post| %p = post.name").should == "<% @posts.each do |post| %><%= post.name %>
<% end %>" end end end end