Sha256: c1722d43537ceabe4867689613635084d8ed2369c5256074d193764bb0633092
Contents?: true
Size: 643 Bytes
Versions: 24
Compression:
Stored size: 643 Bytes
Contents
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
24 entries across 24 versions & 1 rubygems