forked from elastic/elasticsearch-rails
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathclient_test.rb
27 lines (23 loc) · 886 Bytes
/
client_test.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
require 'test_helper'
class Elasticsearch::Model::ClientTest < Test::Unit::TestCase
context "Client module" do
class ::DummyClientModel
extend Elasticsearch::Model::Client::ClassMethods
include Elasticsearch::Model::Client::InstanceMethods
end
should "have the default client method" do
assert_instance_of Elasticsearch::Transport::Client, DummyClientModel.client
assert_instance_of Elasticsearch::Transport::Client, DummyClientModel.new.client
end
should "set the client for the model" do
DummyClientModel.client = 'foobar'
assert_equal 'foobar', DummyClientModel.client
assert_equal 'foobar', DummyClientModel.new.client
end
should "set the client for a model instance" do
instance = DummyClientModel.new
instance.client = 'moobam'
assert_equal 'moobam', instance.client
end
end
end