Sha256: 127ad996f9273255a094b0dd731c9c6b464c94a2fdec54c87dc5cb373835b86d

Contents?: true

Size: 760 Bytes

Versions: 5

Compression:

Stored size: 760 Bytes

Contents

require "spec_helper"
require "action_view"

describe ActionView::Base do
  describe "#stripped" do
    it "should call Vidibus::Textile::Doc#to_text" do
      mock.any_instance_of(Vidibus::Textile::Doc).to_text({})
      subject.stripped("something")
    end

    it "should accept options" do
      mock.any_instance_of(Vidibus::Textile::Doc).to_text(:plain => true)
      subject.stripped("something", :plain => true)
    end

    it "should work as intended" do
      subject.stripped('Some *say*, "love":http://doit.xxx is a _river_.').should eql("Some say, love is a river.")
    end

    it "should handle empty content" do
      dont_allow.any_instance_of(Vidibus::Textile::Doc).to_text({})
      subject.stripped(nil).should eql("")
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
vidibus-textile-0.2.4 spec/vidibus/textile/action_view_spec.rb
vidibus-textile-0.2.3 spec/vidibus/textile/action_view_spec.rb
vidibus-textile-0.2.2 spec/vidibus/textile/action_view_spec.rb
vidibus-textile-0.2.1 spec/vidibus/textile/action_view_spec.rb
vidibus-textile-0.2.0 spec/vidibus/textile/action_view_spec.rb