debian-mirror-gitlab/elasticsearch-rails/elasticsearch-model/spec/elasticsearch/model/serializing_spec.rb
2021-03-05 16:19:46 +05:30

22 lines
410 B
Ruby

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