Sha256: b7cb218433421db419050d63d971ce24649534ed45c0181b44ffbcf4fa2deb2d

Contents?: true

Size: 1.04 KB

Versions: 55

Compression:

Stored size: 1.04 KB

Contents

require 'spec_helper'

describe ActiveFedora::UnsavedDigitalObject do
  
  describe "an unsaved instance" do
    before do
      @obj = ActiveFedora::UnsavedDigitalObject.new(ActiveFedora::Base, 'bar') 
    end
    it "should have ownerId property" do
      @obj.ownerId = 'fooo'
      @obj.ownerId.should == 'fooo'
    end

    it "should have a default pid" do
      @obj.pid.should == "__DO_NOT_USE__"
    end
    it "should be able to set the pid" do
      @obj.pid = "my:new_object"
      @obj.pid.should == "my:new_object"
    end
  end


  describe "#save" do
    before :all do
      obj = ActiveFedora::UnsavedDigitalObject.new(ActiveFedora::Base, 'bar') 
      obj.label = 'my label'
      obj.ownerId = 'fooo'
      @saved_obj = obj.save
    end
    it "should be a digital object" do
      @saved_obj.should be_kind_of ActiveFedora::DigitalObject
    end
    it "should set the ownerId property" do
      @saved_obj.ownerId.should == 'fooo'
    end
    it "should set the label property" do
      @saved_obj.label.should == 'my label'
    end
  end

end

Version data entries

55 entries across 55 versions & 1 rubygems

Version Path
active-fedora-5.7.1 spec/unit/unsaved_digital_object_spec.rb
active-fedora-5.7.0 spec/unit/unsaved_digital_object_spec.rb
active-fedora-6.1.1 spec/unit/unsaved_digital_object_spec.rb
active-fedora-6.1.0 spec/unit/unsaved_digital_object_spec.rb
active-fedora-5.6.3 spec/unit/unsaved_digital_object_spec.rb
active-fedora-6.0.0 spec/unit/unsaved_digital_object_spec.rb
active-fedora-6.0.0.rc7 spec/unit/unsaved_digital_object_spec.rb
active-fedora-6.0.0.rc6 spec/unit/unsaved_digital_object_spec.rb
active-fedora-6.0.0.rc5 spec/unit/unsaved_digital_object_spec.rb
active-fedora-6.0.0.rc4 spec/unit/unsaved_digital_object_spec.rb
active-fedora-6.0.0.rc3 spec/unit/unsaved_digital_object_spec.rb
active-fedora-6.0.0.rc2 spec/unit/unsaved_digital_object_spec.rb
active-fedora-6.0.0.rc1 spec/unit/unsaved_digital_object_spec.rb
active-fedora-5.6.2 spec/unit/unsaved_digital_object_spec.rb
active-fedora-5.6.1 spec/unit/unsaved_digital_object_spec.rb
active-fedora-6.0.0.pre10 spec/unit/unsaved_digital_object_spec.rb
active-fedora-6.0.0.pre9 spec/unit/unsaved_digital_object_spec.rb
active-fedora-5.6.0 spec/unit/unsaved_digital_object_spec.rb
active-fedora-6.0.0.pre8 spec/unit/unsaved_digital_object_spec.rb
active-fedora-6.0.0.pre7 spec/unit/unsaved_digital_object_spec.rb