require 'spec_helper' describe Locomotive::Liquid::Filters::Html do include Locomotive::Liquid::Filters::Html it 'should return a link tag for a stylesheet file' do result = "" stylesheet_tag('main.css').should == result stylesheet_tag('main').should == result stylesheet_tag(nil).should == '' end it 'should return a script tag for a javascript file' do result = %{} javascript_tag('main.js').should == result javascript_tag('main').should == result javascript_tag(nil).should == '' end it 'should return an image tag without paramaters' do image_tag('foo.jpg').should == "" end it 'should return an image tag with size' do image_tag('foo.jpg', 'width:100', 'height:50').should == "" end it 'should return a flash tag without parameters' do flash_tag('foo.flv').should == %{ }.strip end it 'should return a flash tag with size' do flash_tag('foo.flv', 'width:100', 'height:50').should == %{ }.strip end it 'should return a navigation block for the pagination' do pagination = { "previous" => nil, "parts" => [ { 'title' => '1', 'is_link' => false }, { 'title' => '2', 'is_link' => true, 'url' => '/?page=2' }, { 'title' => '…', 'is_link' => false, 'hellip_break' => true }, { 'title' => '5', 'is_link' => true, 'url' => '/?page=5' } ], "next" => { 'title' => 'next', 'is_link' => true, 'url' => '/?page=2' } } html = default_pagination(pagination, 'css:flickr_pagination') html.should match(/