Sha256: d4f941eedc5e238bce8f79e50239e4044fa44d893e20a381488c34e3bb0ca7c7

Contents?: true

Size: 1.14 KB

Versions: 3

Compression:

Stored size: 1.14 KB

Contents

require 'spec_helper'

describe ActiveFedora::SolrDigitalObject do
  describe "repository" do
    subject { ActiveFedora::SolrDigitalObject.new({},{'datastreams'=>{}}) }
    describe "when not finished" do
      it "should not respond_to? :repository" do
        subject.should_not respond_to :repository
      end
    end
    describe "when finished" do
      before do
        subject.freeze
      end
      it "should respond_to? :repository" do
        subject.should respond_to :repository
      end
    end
  end

  describe "initializing" do
    describe "without a datastream in the ds spec and an xml mime type in the solr doc" do
      before do
        class WithoutMetadataDs < ActiveFedora::Base
          ## No datastreams are defined in this class
        end
      end
      after do
        Object.send(:remove_const, :WithoutMetadataDs)
      end
      subject { ActiveFedora::SolrDigitalObject.new({}, {'datastreams'=>{'properties'=>{'dsMIME'=>'text/xml'}}},WithoutMetadataDs) }
      it "should create an xml datastream" do
        subject.datastreams['properties'].should be_kind_of ActiveFedora::NokogiriDatastream
      end
    end
  end


end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
active-fedora-4.0.0.rc19 spec/unit/solr_digital_object_spec.rb
active-fedora-4.0.0.rc18 spec/unit/solr_digital_object_spec.rb
active-fedora-4.0.0.rc17 spec/unit/solr_digital_object_spec.rb