From e957aa3364fd9793d1b019e117a682dd9e1edf44 Mon Sep 17 00:00:00 2001 From: Clinton Gormley Date: Wed, 18 Sep 2013 15:29:40 +0200 Subject: [PATCH] Changed the get_mapping test to handle versions correctly --- .../test/indices.get_mapping/10_basic.yaml | 35 +++++++++++-------- 1 file changed, 21 insertions(+), 14 deletions(-) diff --git a/rest-api-spec/test/indices.get_mapping/10_basic.yaml b/rest-api-spec/test/indices.get_mapping/10_basic.yaml index 91fd6c65e11..1be7fb9689d 100644 --- a/rest-api-spec/test/indices.get_mapping/10_basic.yaml +++ b/rest-api-spec/test/indices.get_mapping/10_basic.yaml @@ -1,5 +1,5 @@ --- -"Get index mapping": +setup: - do: indices.create: index: test_index @@ -11,6 +11,8 @@ type: string analyzer: whitespace +--- +"Get index mapping": - do: indices.get_mapping: index: test_index @@ -19,26 +21,31 @@ - match: {test_index.test_type.properties.text.analyzer: whitespace} --- -"Get type mapping": - - do: - indices.create: - index: test_index - body: - mappings: - test_type: - properties: - text: - type: string - analyzer: whitespace +"Get type mapping - pre 0.90.2": + + - skip: + version: "0.90.2 - 999" + reason: "for newer versions the index name is always returned" - do: indices.get_mapping: index: test_index type: test_type + - match: {test_index.test_type.properties.text.type: string} + - match: {test_index.test_type.properties.text.analyzer: whitespace} + +--- +"Get type mapping - post 0.90.2": + - skip: - version: "0.90.2 - 999" - reason: "for newer versions the index name is always returned" + version: "0 - 0.90.1" + reason: "for older versions, just the type name is returned" + + - do: + indices.get_mapping: + index: test_index + type: test_type - match: {test_type.properties.text.type: string} - match: {test_type.properties.text.analyzer: whitespace}