Skip to content

Commit 0c33d00

Browse files
committed
[STORE] Added missing test for Elasticsearch::Persistence::Model::Utils.lookup_type
1 parent ff9e664 commit 0c33d00

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

elasticsearch-persistence/test/unit/model_gateway_test.rb

+8
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,14 @@ def run!; DummyGatewayModel.gateway { |g| @b += 1 }; end
7070
DummyGatewayModel.mapping.to_hash[:dummy_gateway_model][:properties][:name][:analyzer]
7171
end
7272

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+
7381
should "remove IDs from hash when serializing" do
7482
assert_equal( {foo: 'bar'}, DummyGatewayModel.gateway.serialize(id: '123', foo: 'bar') )
7583
end

0 commit comments

Comments
 (0)