Sha256: fdb34ed993e54e9602146d9021f7aa7223fcd79284b28c900d4753e5c2b313a7

Contents?: true

Size: 1.18 KB

Versions: 8

Compression:

Stored size: 1.18 KB

Contents

# Need way to find way to stub current_user and RoleMapper in order to run these tests
require File.expand_path( File.join( File.dirname(__FILE__),'..','spec_helper') )


describe Hydra::Datastream::CommonModsIndexMethods do
  describe "extract_person_full_names" do
    it "should return an array of Solr::Field objects for :person_full_name_facet" do
      ma = ModsAsset.find("hydrangea:fixture_mods_article1")
      full_names = ma.datastreams["descMetadata"].extract_person_full_names
      full_names.should be_kind_of Hash
      full_names["person_full_name_facet"].should == ["FAMILY NAME, GIVEN NAMES", "Lacks, Henrietta"]
    end
  end
  describe "extract_person_organizations" do 
    it "should return an array of Solr::Field objects for :mods_organization_facet" do
      orgs = ModsAsset.find("hydrangea:fixture_mods_article1").datastreams["descMetadata"].extract_person_organizations
      orgs.should be_kind_of Hash
      orgs["mods_organization_facet"].should be_kind_of Array
      orgs["mods_organization_facet"].length.should == 2
      orgs["mods_organization_facet"].first.should == "FACULTY, UNIVERSITY"
      orgs["mods_organization_facet"].last.should == "Baltimore"
    end
  end
end


Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
hydra-head-4.0.3 test_support/spec/lib/common_mods_index_methods_spec.rb
hydra-head-4.0.2 test_support/spec/lib/common_mods_index_methods_spec.rb
hydra-head-4.0.1 test_support/spec/lib/common_mods_index_methods_spec.rb
hydra-head-4.0.0 test_support/spec/lib/common_mods_index_methods_spec.rb
hydra-head-4.0.0.rc6 test_support/spec/lib/common_mods_index_methods_spec.rb
hydra-head-4.0.0.rc5 test_support/spec/lib/common_mods_index_methods_spec.rb
hydra-head-4.0.0.rc4 test_support/spec/lib/common_mods_index_methods_spec.rb
hydra-head-4.0.0.rc3 test_support/spec/lib/common_mods_index_methods_spec.rb