Sha256: f9719cfb9efb37bc003cdc0520bfed8025d44867305e981d4a09c762afebad56

Contents?: true

Size: 990 Bytes

Versions: 13

Compression:

Stored size: 990 Bytes

Contents

require 'test_helper'

module Elasticsearch
  module Test
    class ClusterStateTest < ::Test::Unit::TestCase

      context "Cluster: State" do
        subject { FakeClient.new }

        should "perform correct request" do
          subject.expects(:perform_request).with do |method, url, params, body|
            assert_equal 'GET', method
            assert_equal '_cluster/state', url
            assert_equal Hash.new, params
            assert_nil   body
            true
          end.returns(FakeResponse.new)

          subject.cluster.state
        end

        should "send the API parameters" do
          subject.expects(:perform_request).with do |method, url, params, body|
            assert_equal 'GET', method
            assert_equal '_cluster/state', url
            assert_equal({:filter_blocks => true}, params)
            true
          end.returns(FakeResponse.new)

          subject.cluster.state :filter_blocks => true
        end

      end

    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
elasticsearch-api-0.4.11 test/unit/cluster/state_test.rb
elasticsearch-api-0.4.10 test/unit/cluster/state_test.rb
elasticsearch-api-0.4.9 test/unit/cluster/state_test.rb
elasticsearch-api-0.4.8 test/unit/cluster/state_test.rb
elasticsearch-api-0.4.7 test/unit/cluster/state_test.rb
elasticsearch-api-0.4.6 test/unit/cluster/state_test.rb
elasticsearch-api-0.4.5 test/unit/cluster/state_test.rb
elasticsearch-api-0.4.4 test/unit/cluster/state_test.rb
elasticsearch-api-0.4.3 test/unit/cluster/state_test.rb
elasticsearch-api-0.4.2 test/unit/cluster/state_test.rb
elasticsearch-api-0.4.1 test/unit/cluster/state_test.rb
elasticsearch-api-0.4.0 test/unit/cluster/state_test.rb
elasticsearch-api-0.0.2 test/unit/cluster/state_test.rb