debian-mirror-gitlab/elasticsearch-model/spec/elasticsearch/model/serializing_spec.rb
2020-03-09 13:42:32 +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