Sha256: a2f6cf8f22bcf66cbce88807a3b3d6877abc0de839c0881011d55aea678cf0d0

Contents?: true

Size: 666 Bytes

Versions: 27

Compression:

Stored size: 666 Bytes

Contents

require 'spec_helper'

describe Spotlight::FeaturedImage do
  context 'with an uploaded resource' do
    subject { described_class.new }
    let(:document) { double(uploaded_resource?: true) }

    it 'replaces the remote_image_url fragment with the local path to the file' do
      allow(document).to receive_message_chain(:uploaded_resource, :url, file: File.open(File.join(FIXTURES_PATH, 'avatar.png')))
      allow(subject).to receive(:document).and_return(document)

      subject.remote_image_url = '/some/path'
      expect(subject.remote_image_url).to be_nil

      subject.validate

      expect(subject.image.filename).to eq 'avatar.png'
    end
  end
end

Version data entries

27 entries across 27 versions & 1 rubygems

Version Path
blacklight-spotlight-0.18.0 spec/models/spotlight/featured_image_spec.rb
blacklight-spotlight-0.17.1 spec/models/spotlight/featured_image_spec.rb
blacklight-spotlight-0.17.0 spec/models/spotlight/featured_image_spec.rb
blacklight-spotlight-0.16.0 spec/models/spotlight/featured_image_spec.rb
blacklight-spotlight-0.15.0 spec/models/spotlight/featured_image_spec.rb
blacklight-spotlight-0.14.2 spec/models/spotlight/featured_image_spec.rb
blacklight-spotlight-0.14.1 spec/models/spotlight/featured_image_spec.rb
blacklight-spotlight-0.14.0 spec/models/spotlight/featured_image_spec.rb
blacklight-spotlight-0.13.0 spec/models/spotlight/featured_image_spec.rb
blacklight-spotlight-0.12.1 spec/models/spotlight/featured_image_spec.rb
blacklight-spotlight-0.12.0 spec/models/spotlight/featured_image_spec.rb
blacklight-spotlight-0.11.0 spec/models/spotlight/featured_image_spec.rb
blacklight-spotlight-0.10.3 spec/models/spotlight/featured_image_spec.rb
blacklight-spotlight-0.10.2 spec/models/spotlight/featured_image_spec.rb
blacklight-spotlight-0.10.1 spec/models/spotlight/featured_image_spec.rb
blacklight-spotlight-0.10.0 spec/models/spotlight/featured_image_spec.rb
blacklight-spotlight-0.9.2 spec/models/spotlight/featured_image_spec.rb
blacklight-spotlight-0.9.1 spec/models/spotlight/featured_image_spec.rb
blacklight-spotlight-0.9.0 spec/models/spotlight/featured_image_spec.rb
blacklight-spotlight-0.8.2 spec/models/spotlight/featured_image_spec.rb