Sha256: 55b3b358932d5771e6aaa73e468e46f9b1b7a49eebf9b4b3fc6fa24ed1e52514
Contents?: true
Size: 1.01 KB
Versions: 7
Compression:
Stored size: 1.01 KB
Contents
require 'spec_helper' describe Hydra::Derivatives::PersistExternalFileOutputFileService do before do class ExternalDerivativeContainerObject < ActiveFedora::Base has_subresource "external_derivative" end end after do Object.send(:remove_const, :ExternalDerivativeContainerObject) end let(:object) { ExternalDerivativeContainerObject.create } let(:directives) { { url: "#{object.uri}/external_derivative" } } let(:external_url) { 'http://www.example.com/external/content' } let(:output) { { url: external_url } } let(:destination_name) { 'external_derivative' } describe '.call' do it "persists the external file to the specified destination on the given object" do described_class.call(output, directives) expect(object.send(destination_name.to_sym).mime_type).to eq "message/external-body;access-type=URL;url=\"http://www.example.com/external/content\"" expect(object.send(destination_name.to_sym).content).to eq '' end end end
Version data entries
7 entries across 7 versions & 1 rubygems