Sha256: 29d359f33005c0d3df1f38d734164e3c78465d5fae6a6401936abe622e15a467

Contents?: true

Size: 1.17 KB

Versions: 12

Compression:

Stored size: 1.17 KB

Contents

require File.join( File.dirname(__FILE__), "..", "spec_helper" )

require 'active_fedora/solr_service'
require 'active_fedora/solr_mapper'

include ActiveFedora::SolrMapper

describe ActiveFedora::SolrMapper do
  
  after(:all) do
    # Revert to default mappings after running tests
    ActiveFedora::SolrService.load_mappings
  end
  
  describe ".solr_name" do
    it "should generate solr field names from settings in solr_mappings" do
      solr_name(:system_create, :date).should == :system_create_dt
    end
    it "should format the response based on the class of the input" do
      solr_name(:system_create, :date).should == :system_create_dt
      solr_name("system_create", :date).should == "system_create_dt"
    end
    it "should rely on whichever mappings have been loaded into the SolrService" do
      solr_name(:system_create, :date).should == :system_create_dt
      solr_name(:foo, :text).should == :foo_t
      ActiveFedora::SolrService.load_mappings(File.join(File.dirname(__FILE__), "..", "..", "config", "solr_mappings_af_0.1.yml"))
      solr_name(:system_create, :date).should == :system_create_date
      solr_name(:foo, :text).should == :foo_field
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
active-fedora-1.1.13 spec/unit/solr_mapper_spec.rb
active-fedora-1.1.11 spec/unit/solr_mapper_spec.rb
active-fedora-1.1.9 spec/unit/solr_mapper_spec.rb
active-fedora-1.1.8 spec/unit/solr_mapper_spec.rb
active-fedora-1.1.7 spec/unit/solr_mapper_spec.rb
active-fedora-1.1.6 spec/unit/solr_mapper_spec.rb
active-fedora-1.1.5 spec/unit/solr_mapper_spec.rb
active-fedora-1.1.4 spec/unit/solr_mapper_spec.rb
active-fedora-1.1.4.pre2 spec/unit/solr_mapper_spec.rb
active-fedora-1.1.2 spec/unit/solr_mapper_spec.rb
active-fedora-1.1.1 spec/unit/solr_mapper_spec.rb
active-fedora-1.1.0 spec/unit/solr_mapper_spec.rb