Sha256: 337d12036de20025ef860c939695306694e4e98bbe4570d9cd961014aa76c491
Contents?: true
Size: 800 Bytes
Versions: 17
Compression:
Stored size: 800 Bytes
Contents
require "spec_helper" module Refinery describe HtmlTruncationHelper do describe "#truncate" do it "returns nil if text is not present" do helper.truncate("").should be_nil end context "when preserve_html_tags option is present" do it "preserve html tags when truncating text" do helper.truncate("<p>Turducken frankfurter ham hock bacon</p>", :preserve_html_tags => true).should eq("<p>Turducken frankfurter ham...</p>") end end context "when preserve_html_tags option is not present" do it "falls back to original truncate method" do helper.truncate("<p>Turducken frankfurter ham hock bacon</p>").should eq("<p>Turducken frankfurter ha...") end end end end end
Version data entries
17 entries across 17 versions & 1 rubygems