Sha256: ab0a14ea8cf90b45870a7e2b19f94187ed302d1dd34bc118d86f9a13e189527c

Contents?: true

Size: 721 Bytes

Versions: 22

Compression:

Stored size: 721 Bytes

Contents

# frozen_string_literal: true

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

  let(:mounter) { Spotlight::Attachment.new(id: '5') }

  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

22 entries across 22 versions & 1 rubygems

Version Path
blacklight-spotlight-3.4.0 spec/uploaders/spotlight/attachment_uploader_spec.rb
blacklight-spotlight-3.3.0 spec/uploaders/spotlight/attachment_uploader_spec.rb
blacklight-spotlight-3.2.0 spec/uploaders/spotlight/attachment_uploader_spec.rb
blacklight-spotlight-3.1.0 spec/uploaders/spotlight/attachment_uploader_spec.rb
blacklight-spotlight-3.0.3 spec/uploaders/spotlight/attachment_uploader_spec.rb
blacklight-spotlight-3.0.2 spec/uploaders/spotlight/attachment_uploader_spec.rb
blacklight-spotlight-3.0.1 spec/uploaders/spotlight/attachment_uploader_spec.rb
blacklight-spotlight-3.0.0 spec/uploaders/spotlight/attachment_uploader_spec.rb
blacklight-spotlight-3.0.0.rc6 spec/uploaders/spotlight/attachment_uploader_spec.rb
blacklight-spotlight-3.0.0.rc5 spec/uploaders/spotlight/attachment_uploader_spec.rb
blacklight-spotlight-3.0.0.rc4 spec/uploaders/spotlight/attachment_uploader_spec.rb
blacklight-spotlight-3.0.0.rc3 spec/uploaders/spotlight/attachment_uploader_spec.rb
blacklight-spotlight-3.0.0.rc2 spec/uploaders/spotlight/attachment_uploader_spec.rb
blacklight-spotlight-3.0.0.rc1 spec/uploaders/spotlight/attachment_uploader_spec.rb
blacklight-spotlight-3.0.0.alpha.10 spec/uploaders/spotlight/attachment_uploader_spec.rb
blacklight-spotlight-3.0.0.alpha.9 spec/uploaders/spotlight/attachment_uploader_spec.rb
blacklight-spotlight-3.0.0.alpha.8 spec/uploaders/spotlight/attachment_uploader_spec.rb
blacklight-spotlight-3.0.0.alpha.7 spec/uploaders/spotlight/attachment_uploader_spec.rb
blacklight-spotlight-3.0.0.alpha.6 spec/uploaders/spotlight/attachment_uploader_spec.rb
blacklight-spotlight-3.0.0.alpha.5 spec/uploaders/spotlight/attachment_uploader_spec.rb