Sha256: 7ecdc26875932a472ae98d72d339f1896634e4535d464596dc3c9ead9e5b22d0

Contents?: true

Size: 1.03 KB

Versions: 47

Compression:

Stored size: 1.03 KB

Contents

require 'test_helper'

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

      context "Indices: Rollover" do
        subject { FakeClient.new }

        should "perform correct request" do
          subject.expects(:perform_request).with do |method, url, params, body|
            assert_equal 'POST', method
            assert_equal 'foo/_rollover', url
            assert_equal Hash.new, params
            assert_equal nil, body
            true
          end.returns(FakeResponse.new)

          subject.indices.rollover :alias => 'foo'
        end

        should "customize the index" do
          subject.expects(:perform_request).with do |method, url, params, body|
            assert_equal 'POST', method
            assert_equal 'foo/_rollover/bar', url
            assert_equal Hash.new, params
            assert_equal nil, body
            true
          end.returns(FakeResponse.new)

          subject.indices.rollover :alias => 'foo', :new_index => 'bar'
        end

      end

    end
  end
end

Version data entries

47 entries across 47 versions & 6 rubygems

Version Path
logstash-filter-cache-redis-0.2.0 vendor/bundle/jruby/1.9/gems/elasticsearch-api-5.0.4/test/unit/indices/rollover_test.rb
elasticsearch-api-5.0.4 test/unit/indices/rollover_test.rb
elasticsearch-api-5.0.3 test/unit/indices/rollover_test.rb
elasticsearch-api-5.0.2 test/unit/indices/rollover_test.rb
elasticsearch-api-5.0.1 test/unit/indices/rollover_test.rb
elasticsearch-api-5.0.0 test/unit/indices/rollover_test.rb
elasticsearch-api-5.0.0.pre test/unit/indices/rollover_test.rb