Sha256: 998b1f5de46f875e2a2433733db3cc26ad473f416c6be0ac9412deb717827ae4

Contents?: true

Size: 1.32 KB

Versions: 10

Compression:

Stored size: 1.32 KB

Contents

require 'test_helper'

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

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

          subject.indices.get_field_mapping :field => 'foo'
        end

        should "perform request against an index" do
          subject.expects(:perform_request).with do |method, url, params, body|
            assert_equal 'foo/_mapping/field/bam', url
            true
          end.returns(FakeResponse.new)

          subject.indices.get_field_mapping :index => 'foo', :field => 'bam'
        end

        should "perform request against an index and type" do
          subject.expects(:perform_request).with do |method, url, params, body|
            assert_equal 'foo/bar/_mapping/field/bam', url
            true
          end.returns(FakeResponse.new)

          subject.indices.get_field_mapping :index => 'foo', :type => 'bar', :field => 'bam'
        end

      end

    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
elasticsearch-api-0.4.11 test/unit/indices/get_field_mapping_test.rb
elasticsearch-api-0.4.10 test/unit/indices/get_field_mapping_test.rb
elasticsearch-api-0.4.9 test/unit/indices/get_field_mapping_test.rb
elasticsearch-api-0.4.8 test/unit/indices/get_field_mapping_test.rb
elasticsearch-api-0.4.7 test/unit/indices/get_field_mapping_test.rb
elasticsearch-api-0.4.6 test/unit/indices/get_field_mapping_test.rb
elasticsearch-api-0.4.5 test/unit/indices/get_field_mapping_test.rb
elasticsearch-api-0.4.4 test/unit/indices/get_field_mapping_test.rb
elasticsearch-api-0.4.3 test/unit/indices/get_field_mapping_test.rb
elasticsearch-api-0.4.2 test/unit/indices/get_field_mapping_test.rb