Sha256: d620ff66c13bed1bf21e048e0ed0967e0e5e3e17f899660eaa54583c344a14e7
Contents?: true
Size: 1.19 KB
Versions: 3
Compression:
Stored size: 1.19 KB
Contents
# 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 = "<p>Lorem <b>ip</b>sum <input type='text'> <img src='test'/> dolor <br> sit <br/> <br /> amet, consectetur adipiscing elit.</p>" helper.html_truncate(html, 22).should eql("<p> Lorem <b> ip </b> sum <input type='text'> <img src='test'/> dolor <br> sit <br/> <br /> amet, </p>") end it "basic text Truncate - truncate length larger than string length" do html = "<p>Lorem <b>ip</b>sum dolor sit amet, consectetur adipiscing elit.</p>" helper.html_truncate(html, 500).should eql(html) end end end
Version data entries
3 entries across 3 versions & 1 rubygems