Sha256: d2d93be37c0fb2b214c58d373925e722f23ae51f7a1fdcf9de98973e359c3783

Contents?: true

Size: 1.15 KB

Versions: 7

Compression:

Stored size: 1.15 KB

Contents

require 'spec_helper'

describe ActiveFedora::Base do
  describe ".update_indexed_attributes" do
    before(:each) do
      @test_article = ModsArticle.find("test:fixture_mods_article1")
      @test_article.descMetadata.update_indexed_attributes({[{:person=>0}, :first_name] => "GIVEN NAMES"})
    end
    after(:each) do
      @test_article.descMetadata.update_indexed_attributes({[{:person=>0}, :first_name] => "GIVEN NAMES"})
    end
    it "should update the xml in the specified datatsream and save those changes to Fedora" do
      @test_article.get_values_from_datastream("descMetadata", [{:person=>0}, :first_name]).should == ["GIVEN NAMES"]
      test_args = {[{:person=>0}, :first_name]=>{"0"=>"Replacement FirstName"}}
      @test_article.descMetadata.update_indexed_attributes(test_args)
      @test_article.get_values_from_datastream("descMetadata", [{:person=>0}, :first_name]).should == ["Replacement FirstName"]
      @test_article.save
      retrieved_article = ModsArticle.find("test:fixture_mods_article1")
      retrieved_article.get_values_from_datastream("descMetadata", [{:person=>0}, :first_name]).should == ["Replacement FirstName"]
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
active-fedora-6.4.2 spec/integration/mods_article_integration_spec.rb
active-fedora-6.4.1 spec/integration/mods_article_integration_spec.rb
active-fedora-6.4.0 spec/integration/mods_article_integration_spec.rb
active-fedora-6.4.0.rc4 spec/integration/mods_article_integration_spec.rb
active-fedora-6.4.0.rc3 spec/integration/mods_article_integration_spec.rb
active-fedora-6.4.0.rc2 spec/integration/mods_article_integration_spec.rb
active-fedora-6.4.0.rc1 spec/integration/mods_article_integration_spec.rb