test/unit/response_result_test.rb in elasticsearch-model-0.1.9 vs test/unit/response_result_test.rb in elasticsearch-model-2.0.0
- old
+ new
@@ -1,6 +1,7 @@
require 'test_helper'
+require 'active_support/json/encoding'
class Elasticsearch::Model::ResultTest < Test::Unit::TestCase
context "Response result" do
should "have method access to properties" do
@@ -78,10 +79,9 @@
assert_equal false, result._source.foo?
assert_equal false, result._source.boo?
end
should "delegate as_json to @result even when ActiveSupport changed half of Ruby" do
- require 'active_support/json/encoding'
result = Elasticsearch::Model::Response::Result.new foo: 'bar'
result.instance_variable_get(:@result).expects(:as_json)
result.as_json(except: 'foo')
end