<commit_before>require "spec_helper"

describe LocSearch do
  fixtures :all

  context ".import_from_sru_response" do
    it "should create a valid manifestation", :vcr => true do
      manifestation = LocSearch.import_from_sru_response( "2007012024" )
      expect( manifestation.manifestation_identifier ).to eq("14780655")
      expect( manifestation.original_title ).to eq( "Everything is miscellaneous : the power of the new digital disorder" )
    end
  end
end<commit_msg>add manifestation mappings for a record.<commit_after>require "spec_helper"

describe LocSearch do
  fixtures :all

  context ".import_from_sru_response" do
    it "should create a valid manifestation", :vcr => true do
      manifestation = LocSearch.import_from_sru_response( "2007012024" )
      expect( manifestation.manifestation_identifier ).to eq("14780655")
      expect( manifestation.original_title ).to eq( "Everything is miscellaneous : the power of the new digital disorder" )
      expect( manifestation.manifestation_content_type.name ).to eq "text"
      expect( manifestation.carrier_type.name ).to eq "print"
      expect( manifestation.publishers.size ).to eq 1
      expect( manifestation.publishers.first.full_name ).to eq "<NAME>"
      expect( manifestation.edition_string ).to eq "1st ed."
      expect( manifestation.language.iso_639_2 ).to eq "eng"
      expect( manifestation.start_page ).to eq 1
      expect( manifestation.end_page ).to eq 277
      expect( manifestation.height ).to eq 25
      expect( manifestation.statement_of_responsibility ).to eq "<NAME>."
      expect( manifestation.subjects.size ).to eq 6
      expect( manifestation.subjects.first.subject_heading_type.name ).to eq "lcsh"
      expect( manifestation.subjects.first.subject_type.name ).to eq "concept"
      RSpec.describe manifestation.subjects.collect( &:term ) do
        it { is_expected.to include( "Knowledge management" ) }
        it { is_expected.to include( "Information technology--Management" ) }
        it { is_expected.to include( "Information technology--Social aspects" ) }
        it { is_expected.to include( "Personal information management" ) }
        it { is_expected.to include( "Information resources management" ) }
        it { is_expected.to include( "Order" ) }
      end
      expect( manifestation.classifications.size ).to eq 1
      classification = manifestation.classifications.first
      expect( classification.classification_type.name ).to eq "ddc"
      expect( classification.category ).to eq "303.48"
      expect( manifestation.identifier_contents("isbn").first ).to eq "9780805080438"
      expect( manifestation.identifier_contents("lccn").first ).to eq "2007012024"
    end
  end
end
{'fraction_non_alphanumeric': 0.09623893805309734, 'fraction_numerical': 0.028761061946902654, 'mean_word_length': 3.7100694444444446, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4914310', 'n_tokens_mistral': 828, 'n_tokens_neox': 733, 'n_words': 220}