Sha256: 3123aabd9a9f761bb0006381900ea41b09a4e96d195ef719731af2f17598298c

Contents?: true

Size: 858 Bytes

Versions: 1

Compression:

Stored size: 858 Bytes

Contents

require 'html/spec_helper'

require 'crystal/spec/xhtml'

describe "BasicHtmlHelper" do
  before :each do        
    @t = Crystal::MockTemplateContext.new
  end
        
  it "tag" do
    @t.tag(:div, 'content', :class => 'hidden').should == %(<div class="hidden">content</div>)
    @t.tag(:div, :class => 'hidden'){'content'}
    @t.buffer.should == %(<div class="hidden">content</div>)
  end
  
  it "stylesheet_link_tag" do
    @t.stylesheet_link_tag('/public/js/app.css').should == %(<link href="/public/js/app.css" media="screen" rel="stylesheet" type="text/css"></link>)
  end
  
  it "image_tag" do
    @t.image_tag('face.png', :width => 100).should == %(<img src="face.png" width="100"></img>)
  end
  
  describe "basic html tags" do
    it "label" do
      @t.label_tag('book', 'Book').should == %(<label for="book">Book</label>)
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
crystal-0.0.13 spec/html/basic_html_helper_spec.rb