File tree 1 file changed +8
-0
lines changed
elasticsearch-persistence/test/unit
1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -70,6 +70,14 @@ def run!; DummyGatewayModel.gateway { |g| @b += 1 }; end
70
70
DummyGatewayModel . mapping . to_hash [ :dummy_gateway_model ] [ :properties ] [ :name ] [ :analyzer ]
71
71
end
72
72
73
+ should "properly look up types for classes" do
74
+ assert_equal 'string' , Elasticsearch ::Persistence ::Model ::Utils ::lookup_type ( String )
75
+ assert_equal 'integer' , Elasticsearch ::Persistence ::Model ::Utils ::lookup_type ( Integer )
76
+ assert_equal 'float' , Elasticsearch ::Persistence ::Model ::Utils ::lookup_type ( Float )
77
+ assert_equal 'date' , Elasticsearch ::Persistence ::Model ::Utils ::lookup_type ( Date )
78
+ assert_equal 'boolean' , Elasticsearch ::Persistence ::Model ::Utils ::lookup_type ( Virtus ::Attribute ::Boolean )
79
+ end
80
+
73
81
should "remove IDs from hash when serializing" do
74
82
assert_equal ( { foo : 'bar' } , DummyGatewayModel . gateway . serialize ( id : '123' , foo : 'bar' ) )
75
83
end
You can’t perform that action at this time.
0 commit comments