# encoding: utf-8 require 'spec_helper' module Gluttonberg describe Public do before :all do end after :all do clean_all_data end it "basic text Truncate - truncate length smaller than string length" do text = "Lorem ipsum dolor sit amet, consectetur adipiscing elit." helper.html_truncate(text, 10).should eql("Lorem ipsum") end it "basic text Truncate - truncate length larger than string length" do text = "Lorem ipsum dolor sit amet, consectetur adipiscing elit." helper.html_truncate(text, 500).should eql(text) end it "basic thml Truncate - truncate length smaller than string length" do html = "
Lorem ipsum dolor
sit
amet, consectetur adipiscing elit.
Lorem ip sum dolor
sit
amet,
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
" helper.html_truncate(html, 500).should eql(html) end end end