Skip to content

Commit

Permalink
Better test coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
awead committed Nov 7, 2012
1 parent a19b6f9 commit 940044a
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion spec/units/field_mapper_spec.rb
Expand Up @@ -201,7 +201,13 @@ class TestMapperLoading < Solrizer::FieldMapper
it "should apply mappings for searchable by default" do
# Just sanity check a couple; copy & pasting all data types is silly
@mapper.solr_names_and_values('foo', 'bar', :string, []).should == { 'foo_t' => ['bar'] }
@mapper.solr_names_and_values('foo', "2012-11-06", :date, []).should == { 'foo_dt' =>["2012-11-06T05:00:00Z"] }
@mapper.solr_names_and_values('foo', "1", :integer, []).should == { 'foo_i' =>["1"] }
end

it "should support full ISO 8601 dates" do
@mapper.solr_names_and_values('foo', "2012-11-06", :date, []).should == { 'foo_dt' =>["2012-11-06T05:00:00Z"] }
@mapper.solr_names_and_values('foo', "November 6th, 2012", :date, []).should == { 'foo_dt' =>["2012-11-06T05:00:00Z"] }
@mapper.solr_names_and_values('foo', Date.parse("6 Nov. 2012"), :date, []).should == { 'foo_dt' =>["2012-11-06T05:00:00Z"] }
end

it "should support displayable, facetable, sortable, unstemmed" do
Expand Down

0 comments on commit 940044a

Please sign in to comment.