Sha256: 280691f16788e9818a313213c06810b7fbee6c4be6c3795864cc67db58d44966

Contents?: true

Size: 971 Bytes

Versions: 7

Compression:

Stored size: 971 Bytes

Contents

require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
require 'solrizer'

describe Solrizer::XML::Extractor do
  
  before(:all) do
    @extractor = Solrizer::Extractor.new
  end
  
  describe ".xml_to_solr" do
    it "should turn simple xml into a solr document" do
      desc_meta = fixture("druid-bv448hq0314-descMetadata.xml")

      result = @extractor.xml_to_solr(desc_meta)
      result[:type_t].should == "text"
      result[:medium_t].should == "Paper Document"
      result[:rights_t].should == "Presumed under copyright. Do not publish."
      result[:date_t].should == "1985-12-30"
      result[:format_t].should be_kind_of(Array)
      result[:format_t].should include("application/tiff")
      result[:format_t].should include("application/pdf")
      result[:format_t].should include("application/jp2000")
      result[:title_t].should == "This is a Sample Title"
      result[:publisher_t].should == "Sample Unversity"

    end
  end
  
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
solrizer-1.1.2 spec/units/xml_extractor_spec.rb
solrizer-1.1.1 spec/units/xml_extractor_spec.rb
solrizer-1.1.0 spec/units/xml_extractor_spec.rb
solrizer-1.0.4 spec/units/xml_extractor_spec.rb
solrizer-1.0.3 spec/units/xml_extractor_spec.rb
solrizer-1.0.2 spec/units/xml_extractor_spec.rb
solrizer-1.0.1 spec/units/xml_extractor_spec.rb