Sha256: 6cedd5eba2428e900a4e396e91c93bf4eca829fc36eab08a245ac4f838faec6d

Contents?: true

Size: 857 Bytes

Versions: 14

Compression:

Stored size: 857 Bytes

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 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

14 entries across 14 versions & 1 rubygems

Version Path
active-fedora-6.4.2 spec/integration/bug_spec.rb
active-fedora-6.4.1 spec/integration/bug_spec.rb
active-fedora-6.4.0 spec/integration/bug_spec.rb
active-fedora-6.4.0.rc4 spec/integration/bug_spec.rb
active-fedora-6.4.0.rc3 spec/integration/bug_spec.rb
active-fedora-6.4.0.rc2 spec/integration/bug_spec.rb
active-fedora-6.4.0.rc1 spec/integration/bug_spec.rb
active-fedora-6.3.0 spec/integration/bug_spec.rb
active-fedora-6.2.0 spec/integration/bug_spec.rb
active-fedora-6.1.1 spec/integration/bug_spec.rb
active-fedora-6.1.0 spec/integration/bug_spec.rb
active-fedora-6.0.0 spec/integration/bug_spec.rb
active-fedora-6.0.0.rc7 spec/integration/bug_spec.rb
active-fedora-6.0.0.rc6 spec/integration/bug_spec.rb