Sha256: a907e74cdb6369804a054efa59300a431a965988e6c0d7c9699eabab5a4fedf4

Contents?: true

Size: 1.06 KB

Versions: 10

Compression:

Stored size: 1.06 KB

Contents

require 'test_helper'

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

      context "Ingest: Get pipeline" do
        subject { FakeClient.new }

        should "require the :id argument" do
          assert_raise ArgumentError do
            subject.ingest.get_pipeline
          end
        end

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

          subject.ingest.get_pipeline :id => 'foo'
        end

        should "URL-escape the ID" do
          subject.expects(:perform_request).with do |method, url, params, body|
            assert_equal '_ingest/pipeline/foo%5Ebar', url
            true
          end.returns(FakeResponse.new)

          subject.ingest.get_pipeline :id => 'foo^bar'
        end

      end

    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
elasticsearch-api-1.1.3 test/unit/ingest/get_pipeline_test.rb
elasticsearch-api-2.0.2 test/unit/ingest/get_pipeline_test.rb
elasticsearch-api-2.0.1 test/unit/ingest/get_pipeline_test.rb
elasticsearch-api-1.1.2 test/unit/ingest/get_pipeline_test.rb
elasticsearch-api-1.1.1 test/unit/ingest/get_pipeline_test.rb
elasticsearch-api-2.0.0 test/unit/ingest/get_pipeline_test.rb
elasticsearch-api-1.1.0 test/unit/ingest/get_pipeline_test.rb
elasticsearch-api-2.0.0.pre test/unit/ingest/get_pipeline_test.rb
elasticsearch-api-1.1.pre test/unit/ingest/get_pipeline_test.rb
elasticsearch-api-1.0.18 test/unit/ingest/get_pipeline_test.rb