Sha256: cac603f6953a71e4f02ab9bf5451bbe11d84ae8f2432350885d1df864715b61c

Contents?: true

Size: 1.03 KB

Versions: 12

Compression:

Stored size: 1.03 KB

Contents

require 'test_helper'

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

      context "Clear scroll" do
        subject { FakeClient.new }

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

          subject.clear_scroll :scroll_id => 'abc123'
        end

        should "listify scroll IDs" do
          subject.expects(:perform_request).with do |method, url, params, body|
            assert_equal 'DELETE', method
            assert_equal '_search/scroll/abc123,def456', url
            assert_equal Hash.new, params
            assert_nil   body
            true
          end.returns(FakeResponse.new)

          subject.clear_scroll :scroll_id => ['abc123', 'def456']
        end

      end

    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
elasticsearch-api-1.0.6 test/unit/clear_scroll_test.rb
elasticsearch-api-1.0.5 test/unit/clear_scroll_test.rb
elasticsearch-api-1.0.4 test/unit/clear_scroll_test.rb
elasticsearch-api-1.0.2 test/unit/clear_scroll_test.rb
elasticsearch-api-1.0.1 test/unit/clear_scroll_test.rb
elasticsearch-api-1.0.0 test/unit/clear_scroll_test.rb
elasticsearch-api-0.4.11 test/unit/clear_scroll_test.rb
elasticsearch-api-0.4.10 test/unit/clear_scroll_test.rb
elasticsearch-api-0.4.9 test/unit/clear_scroll_test.rb
elasticsearch-api-1.0.0.rc2 test/unit/clear_scroll_test.rb
elasticsearch-api-1.0.0.rc1 test/unit/clear_scroll_test.rb
elasticsearch-api-0.4.8 test/unit/clear_scroll_test.rb