Sha256: b7cf421b3f1978b988b95c5cfc554ccbbe3ec42cd9e9e7301f10bc763f7d5153

Contents?: true

Size: 1.01 KB

Versions: 51

Compression:

Stored size: 1.01 KB

Contents

require 'spec_helper'

require 'active_fedora'
require 'active_fedora/model'
require "rexml/document"
include ActiveFedora::Model

describe 'bugs' do
  before do
    class FooHistory < ActiveFedora::Base
      has_metadata :type=>ActiveFedora::SimpleDatastream, :name=>"someData" do |m|
        m.field "fubar", :string
      end
    end
    @test_object = FooHistory.new
    @test_object.save
  end
  after do
    @test_object.delete
    Object.send(:remove_const, :FooHistory)
  end

  it 'should raise ActiveFedora::ObjectNotFoundError when find("")' do
    expect {
      FooHistory.find('')
    }.to raise_error(ActiveFedora::ObjectNotFoundError)
  end

  it "should not clobber everything when setting a value" do
    @test_object.someData.fubar=['initial']
    @test_object.save!

    x = FooHistory.find(@test_object.pid)
    x.someData.fubar = ["replacement"] # set a new value
    x.save!


    x = FooHistory.find(@test_object.pid)
    x.someData.fubar.should == ["replacement"] # recall the value
    x.save
  end
end

Version data entries

51 entries across 51 versions & 1 rubygems

Version Path
active-fedora-7.3.1 spec/integration/bug_spec.rb
active-fedora-7.3.0 spec/integration/bug_spec.rb
active-fedora-8.2.1 spec/integration/bug_spec.rb
active-fedora-8.2.0 spec/integration/bug_spec.rb
active-fedora-7.2.0 spec/integration/bug_spec.rb
active-fedora-8.1.0 spec/integration/bug_spec.rb
active-fedora-8.0.1 spec/integration/bug_spec.rb
active-fedora-8.0.0 spec/integration/bug_spec.rb
active-fedora-8.0.0.rc3 spec/integration/bug_spec.rb
active-fedora-8.0.0.rc2 spec/integration/bug_spec.rb
active-fedora-8.0.0.rc1 spec/integration/bug_spec.rb
active-fedora-7.1.2 spec/integration/bug_spec.rb
active-fedora-7.1.1 spec/integration/bug_spec.rb
active-fedora-7.1.0 spec/integration/bug_spec.rb
active-fedora-6.7.8 spec/integration/bug_spec.rb
active-fedora-7.0.4 spec/integration/bug_spec.rb
active-fedora-7.0.3 spec/integration/bug_spec.rb
active-fedora-7.0.2 spec/integration/bug_spec.rb
active-fedora-7.0.1 spec/integration/bug_spec.rb
active-fedora-7.0.0 spec/integration/bug_spec.rb