Sha256: 9b0945b31224b78fbaa5844dac89e95b08766771413b0872cb95c89625f81d81

Contents?: true

Size: 545 Bytes

Versions: 11

Compression:

Stored size: 545 Bytes

Contents

require 'spec_helper'

module Alchemy
  describe EssenceFile do

    describe '#preview_text' do
      let(:attachment) { mock_model(Attachment, name: 'File') }
      let(:essence) { EssenceFile.new }

      it "returns the attachment's name as preview text" do
        essence.stub(:attachment).and_return(attachment)
        essence.preview_text.should == 'File'
      end

      context "with no attachment assigned" do
        it "returns empty string" do
          essence.preview_text.should == ''
        end
      end
    end

  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
alchemy_cms-2.9.1 spec/models/essence_file_spec.rb
alchemy_cms-2.9.0 spec/models/essence_file_spec.rb
alchemy_cms-2.8.3 spec/models/essence_file_spec.rb
alchemy_cms-2.7.5 spec/models/essence_file_spec.rb
alchemy_cms-2.7.4 spec/models/essence_file_spec.rb
alchemy_cms-2.8.2 spec/models/essence_file_spec.rb
alchemy_cms-2.8.1 spec/models/essence_file_spec.rb
alchemy_cms-2.7.3 spec/models/essence_file_spec.rb
alchemy_cms-2.7.2 spec/models/essence_file_spec.rb
alchemy_cms-2.7.1 spec/models/essence_file_spec.rb
alchemy_cms-2.7.0 spec/models/essence_file_spec.rb