Sha256: 12e78b5d639ca17267df3bba574e0f1f904add10ec757c80d3c068849ddd6fa2

Contents?: true

Size: 891 Bytes

Versions: 1

Compression:

Stored size: 891 Bytes

Contents

require "#{File.expand_path(File.dirname(__FILE__))}/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_ext-0.0.11 spec/html/basic_html_helper_spec.rb