Sha256: 62abeb39daa511697afafc6cebb937e9438dbec93e8ca20754ee5f7d5c9e6a8f

Contents?: true

Size: 689 Bytes

Versions: 33

Compression:

Stored size: 689 Bytes

Contents

describe Spotlight::AttachmentUploader do
  let(:mounter) { Spotlight::Attachment.new(id: '5') }
  subject(:attachment_uploader) { described_class.new(mounter, 'mounted_as') }

  describe '#store_dir' do
    let(:store_dir) { attachment_uploader.store_dir }

    it 'is prefixed with "uploads/spotlight"' do
      expect(store_dir).to start_with 'uploads/spotlight/'
    end

    it "includes the mounter's class name" do
      expect(store_dir).to match '/attachment/'
    end

    it 'includes the mounted_as option' do
      expect(store_dir).to match '/mounted_as/'
    end

    it "ends with the mounter's id" do
      expect(store_dir).to end_with "/#{mounter.id}"
    end
  end
end

Version data entries

33 entries across 33 versions & 1 rubygems

Version Path
blacklight-spotlight-2.4.1 spec/uploaders/spotlight/attachment_uploader_spec.rb
blacklight-spotlight-2.4.0 spec/uploaders/spotlight/attachment_uploader_spec.rb
blacklight-spotlight-2.3.3 spec/uploaders/spotlight/attachment_uploader_spec.rb
blacklight-spotlight-2.3.2 spec/uploaders/spotlight/attachment_uploader_spec.rb
blacklight-spotlight-2.3.1 spec/uploaders/spotlight/attachment_uploader_spec.rb
blacklight-spotlight-2.3.0 spec/uploaders/spotlight/attachment_uploader_spec.rb
blacklight-spotlight-2.2.1 spec/uploaders/spotlight/attachment_uploader_spec.rb
blacklight-spotlight-2.2.0 spec/uploaders/spotlight/attachment_uploader_spec.rb
blacklight-spotlight-2.1.0 spec/uploaders/spotlight/attachment_uploader_spec.rb
blacklight-spotlight-2.0.2 spec/uploaders/spotlight/attachment_uploader_spec.rb
blacklight-spotlight-2.0.1 spec/uploaders/spotlight/attachment_uploader_spec.rb
blacklight-spotlight-2.0.0 spec/uploaders/spotlight/attachment_uploader_spec.rb
blacklight-spotlight-2.0.0.rc6 spec/uploaders/spotlight/attachment_uploader_spec.rb
blacklight-spotlight-2.0.0.rc5 spec/uploaders/spotlight/attachment_uploader_spec.rb
blacklight-spotlight-2.0.0.rc4 spec/uploaders/spotlight/attachment_uploader_spec.rb
blacklight-spotlight-2.0.0.rc3 spec/uploaders/spotlight/attachment_uploader_spec.rb
blacklight-spotlight-2.0.0.rc2 spec/uploaders/spotlight/attachment_uploader_spec.rb
blacklight-spotlight-2.0.0.rc1 spec/uploaders/spotlight/attachment_uploader_spec.rb
blacklight-spotlight-1.5.1 spec/uploaders/spotlight/attachment_uploader_spec.rb
blacklight-spotlight-1.4.1 spec/uploaders/spotlight/attachment_uploader_spec.rb