Sha256: ee99da3eef5024abcc86a82baa5bec22d80ace0438a0e1977b879b1bc4761c0b
Contents?: true
Size: 1.38 KB
Versions: 2
Compression:
Stored size: 1.38 KB
Contents
require 'spec_helper' describe Solrizer::Common do before do class Foo include Solrizer::Common end end after do Object.send(:remove_const, :Foo) end it "should handle many field types" do solr_doc = {} Foo.create_and_insert_terms('my_name', 'value', [:displayable, :searchable, :sortable], solr_doc) solr_doc.should == {'my_name_ssm' => ['value'], 'my_name_si' => ['value'], 'my_name_teim' => ['value']} end it "should handle dates that are searchable" do solr_doc = {} Foo.create_and_insert_terms('my_name', Date.parse('2013-01-10'), [:stored_searchable], solr_doc) solr_doc.should == {'my_name_dtsim' => ['2013-01-10T00:00:00Z']} end it "should handle dates that are stored_sortable" do solr_doc = {} Foo.create_and_insert_terms('my_name', Date.parse('2013-01-10'), [:stored_sortable], solr_doc) solr_doc.should == {'my_name_dtsi' => ['2013-01-10T00:00:00Z']} end it "should handle dates that are displayable" do solr_doc = {} Foo.create_and_insert_terms('my_name', Date.parse('2013-01-10'), [:displayable], solr_doc) solr_doc.should == {'my_name_ssm' => ['2013-01-10']} end it "should handle dates that are sortable" do solr_doc = {} Foo.create_and_insert_terms('my_name', Date.parse('2013-01-10'), [:sortable], solr_doc) solr_doc.should == {'my_name_dti' => ['2013-01-10T00:00:00Z']} end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
solrizer-3.0.0 | spec/units/common_spec.rb |
solrizer-3.0.0.rc2 | spec/units/common_spec.rb |