Sha256: 1f5ad517b2e01538b0da1584984bfb59bc70a50a51529b394c65caef13cfc051
Contents?: true
Size: 1.22 KB
Versions: 3
Compression:
Stored size: 1.22 KB
Contents
require 'spec_helper' describe Hydra::Derivatives::PersistBasicContainedOutputFileService do before(:all) do class BasicContainerObject < ActiveFedora::Base has_subresource "the_derivative_name" end end let(:object) { BasicContainerObject.new } let(:file_path) { File.join(fixture_path, 'test.tif') } let(:file) { File.new(file_path)} let(:destination_name) { 'the_derivative_name' } # alas, we have to support this as the default because all legacy code (and fedora 3 systems) created basic contained files # The new signature does not have a destination_name option. There is a default string that will get applied, but his might # not be sufficient. context "when file is basic contained (default assumption)" do let(:object) { BasicContainerObject.create } let(:stream) { StringIO.new("fake file content") } it "persists the file to the specified destination on the given object" do described_class.call(stream, { format: 'jpg', url: "#{object.uri}/the_derivative_name" }) expect(object.send(destination_name.to_sym).content).to eq("fake file content") expect(object.send(destination_name.to_sym).content_changed?).to eq false end end end
Version data entries
3 entries across 3 versions & 1 rubygems