Sha256: 124c8125279f221218a583b54a71df93a5ba1f99fdcc7cf369a8068528755287

Contents?: true

Size: 932 Bytes

Versions: 20

Compression:

Stored size: 932 Bytes

Contents

require 'test_helper'

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

      context "Indices: Get template" 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 '_template/foo', url
            assert_equal Hash.new, params
            assert_nil   body
            true
          end.returns(FakeResponse.new)

          subject.indices.get_template :name => 'foo'
        end

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

          subject.indices.get_template :name => 'foo^bar'
        end


      end

    end
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
elasticsearch-api-1.0.7 test/unit/indices/get_template_test.rb
elasticsearch-api-1.0.6 test/unit/indices/get_template_test.rb
elasticsearch-api-1.0.5 test/unit/indices/get_template_test.rb
elasticsearch-api-1.0.4 test/unit/indices/get_template_test.rb
elasticsearch-api-1.0.2 test/unit/indices/get_template_test.rb
elasticsearch-api-1.0.1 test/unit/indices/get_template_test.rb
elasticsearch-api-1.0.0 test/unit/indices/get_template_test.rb
elasticsearch-api-0.4.11 test/unit/indices/get_template_test.rb
elasticsearch-api-0.4.10 test/unit/indices/get_template_test.rb
elasticsearch-api-0.4.9 test/unit/indices/get_template_test.rb
elasticsearch-api-1.0.0.rc2 test/unit/indices/get_template_test.rb
elasticsearch-api-1.0.0.rc1 test/unit/indices/get_template_test.rb
elasticsearch-api-0.4.8 test/unit/indices/get_template_test.rb
elasticsearch-api-0.4.7 test/unit/indices/get_template_test.rb
elasticsearch-api-0.4.6 test/unit/indices/get_template_test.rb
elasticsearch-api-0.4.5 test/unit/indices/get_template_test.rb
elasticsearch-api-0.4.4 test/unit/indices/get_template_test.rb
elasticsearch-api-0.4.3 test/unit/indices/get_template_test.rb
elasticsearch-api-0.4.2 test/unit/indices/get_template_test.rb
elasticsearch-api-0.4.1 test/unit/indices/get_template_test.rb