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

23 lines
410 B
Ruby
Raw Normal View History

2020-03-13 15:44:24 +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