Sha256: 02c9fb2d912b87aaace03f8f792a523a380991ed01c69b16c74ceb74e04be945

Contents?: true

Size: 1013 Bytes

Versions: 17

Compression:

Stored size: 1013 Bytes

Contents

require 'spec_helper'

describe Locomotive::Liquid::Filters::Text do

  include Locomotive::Liquid::Filters::Text

  it 'transforms a textile input into HTML' do
    textile('This is *my* text.').should == "<p>This is <strong>my</strong> text.</p>"
  end

  it 'transforms a markdown input into HTML' do
    markdown('# My title').should == "<h1>My title</h1>\n"
  end

  it 'underscores an input' do
    underscore('foo').should == 'foo'
    underscore('home page').should == 'home_page'
    underscore('My foo Bar').should == 'my_foo_bar'
    underscore('foo/bar').should == 'foo_bar'
    underscore('foo/bar/index').should == 'foo_bar_index'
  end

  it 'dasherizes an input' do
    dasherize('foo').should == 'foo'
    dasherize('foo_bar').should == 'foo-bar'
    dasherize('foo/bar').should == 'foo-bar'
    dasherize('foo/bar/index').should == 'foo-bar-index'
  end

  it 'concats strings' do
    concat('foo', 'bar').should == 'foobar'
    concat('hello', 'foo', 'bar').should == 'hellofoobar'
  end


end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
locomotive_cms-2.5.7 spec/lib/locomotive/liquid/filters/text_spec.rb
locomotive_cms-2.5.6 spec/lib/locomotive/liquid/filters/text_spec.rb
locomotive_cms-2.5.6.rc2 spec/lib/locomotive/liquid/filters/text_spec.rb
locomotive_cms-2.5.6.rc1 spec/lib/locomotive/liquid/filters/text_spec.rb
locomotive_cms-2.5.5 spec/lib/locomotive/liquid/filters/text_spec.rb
locomotive_cms-2.5.4 spec/lib/locomotive/liquid/filters/text_spec.rb
locomotive_cms-2.5.3 spec/lib/locomotive/liquid/filters/text_spec.rb
locomotive_cms-2.5.2 spec/lib/locomotive/liquid/filters/text_spec.rb
locomotive_cms-2.5.1 spec/lib/locomotive/liquid/filters/text_spec.rb
locomotive_cms-2.5.0 spec/lib/locomotive/liquid/filters/text_spec.rb
locomotive_cms-2.5.0.rc3 spec/lib/locomotive/liquid/filters/text_spec.rb
locomotive_cms-2.5.0.rc2 spec/lib/locomotive/liquid/filters/text_spec.rb
locomotive_cms-2.5.0.rc1 spec/lib/locomotive/liquid/filters/text_spec.rb
locomotive_cms-2.4.1 spec/lib/locomotive/liquid/filters/text_spec.rb
locomotive_cms-2.4.0 spec/lib/locomotive/liquid/filters/text_spec.rb
locomotive_cms-2.3.1 spec/lib/locomotive/liquid/filters/text_spec.rb
locomotive_cms-2.3.0 spec/lib/locomotive/liquid/filters/text_spec.rb