debian-mirror-gitlab/elasticsearch-model/spec/elasticsearch/model/serializing_spec.rb

23 lines
410 B
Ruby
Raw Normal View History

2020-03-09 13:42:32 +05:30
require 'spec_helper'
describe Elasticsearch::Model::Serializing do
before(:all) do
class DummyClass
include Elasticsearch::Model::Serializing::InstanceMethods
def as_json(options={})
'HASH'
end
end
end
after(:all) do
remove_classes(DummyClass)
end
it 'delegates to #as_json by default' do
expect(DummyClass.new.as_indexed_json).to eq('HASH')
end
end