Sha256: 72b914c7ee09dfa2828c0ec3c6d7a7f35d87a4637084d0749c7b498e1a9ce197

Contents?: true

Size: 1.34 KB

Versions: 27

Compression:

Stored size: 1.34 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::CommonModsIndexMethods do
  describe "extract_person_full_names" do
    it "should return an array of Solr::Field objects for :person_full_name_facet" do
      full_names = ModsAsset.find("hydrangea:fixture_mods_article1").datastreams["descMetadata"].extract_person_full_names
      full_names.should be_kind_of Hash
      full_names["person_full_name_facet"].should be_kind_of Array
      full_names["person_full_name_facet"].length.should == 2
      full_names["person_full_name_facet"].first.should == "FAMILY NAME, GIVEN NAMES"
      full_names["person_full_name_facet"].last.should == "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

27 entries across 27 versions & 1 rubygems

Version Path
hydra-head-3.2.2 test_support/spec/lib/common_mods_index_methods_spec.rb
hydra-head-3.2.1 test_support/spec/lib/common_mods_index_methods_spec.rb
hydra-head-3.2.0 test_support/spec/lib/common_mods_index_methods_spec.rb
hydra-head-3.2.0.pre3 test_support/spec/lib/common_mods_index_methods_spec.rb
hydra-head-3.2.0.pre2 test_support/spec/lib/common_mods_index_methods_spec.rb
hydra-head-3.2.0.pre1 test_support/spec/lib/common_mods_index_methods_spec.rb
hydra-head-3.1.5 test_support/spec/lib/common_mods_index_methods_spec.rb
hydra-head-3.1.4 test_support/spec/lib/common_mods_index_methods_spec.rb
hydra-head-3.1.3 test_support/spec/lib/common_mods_index_methods_spec.rb
hydra-head-3.1.2 test_support/spec/lib/common_mods_index_methods_spec.rb
hydra-head-3.1.1 test_support/spec/lib/common_mods_index_methods_spec.rb
hydra-head-3.1.0 test_support/spec/lib/common_mods_index_methods_spec.rb
hydra-head-3.1.0.rc2 test_support/spec/lib/common_mods_index_methods_spec.rb
hydra-head-3.1.0.rc1 test_support/spec/lib/common_mods_index_methods_spec.rb
hydra-head-3.1.0.pre5 test_support/spec/lib/common_mods_index_methods_spec.rb
hydra-head-3.1.0.pre4 test_support/spec/lib/common_mods_index_methods_spec.rb
hydra-head-3.1.0.pre3 test_support/spec/lib/common_mods_index_methods_spec.rb
hydra-head-3.0.1 test_support/spec/lib/common_mods_index_methods_spec.rb
hydra-head-3.1.0.pre2 test_support/spec/lib/common_mods_index_methods_spec.rb
hydra-head-3.0.0 test_support/spec/lib/common_mods_index_methods_spec.rb