From cb4b04e49f953f3e93c2747649ee23a3586be641 Mon Sep 17 00:00:00 2001 From: Karel Minarik Date: Mon, 9 Sep 2013 15:29:31 +0200 Subject: [PATCH] Added tests for default document type in `get` and `get_source` APIs --- rest-api-spec/test/get/15_default_values.yaml | 20 +++++++++++++++++++ rest-api-spec/test/get/20_fields.yaml | 2 +- .../test/get_source/15_default_values.yaml | 16 +++++++++++++++ 3 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 rest-api-spec/test/get/15_default_values.yaml create mode 100644 rest-api-spec/test/get_source/15_default_values.yaml diff --git a/rest-api-spec/test/get/15_default_values.yaml b/rest-api-spec/test/get/15_default_values.yaml new file mode 100644 index 00000000000..012b6ee1369 --- /dev/null +++ b/rest-api-spec/test/get/15_default_values.yaml @@ -0,0 +1,20 @@ +--- +"Default values": + + - do: + index: + index: test_1 + type: test + id: 1 + body: { "foo": "bar" } + + - do: + get: + index: test_1 + id: 1 + + - match: { _index: test_1 } + - match: { _type: test } + - match: { _id: '1' } + - match: { _source: { foo: "bar" } } + diff --git a/rest-api-spec/test/get/20_fields.yaml b/rest-api-spec/test/get/20_fields.yaml index 6d85c5d86f5..803f428e6d3 100644 --- a/rest-api-spec/test/get/20_fields.yaml +++ b/rest-api-spec/test/get/20_fields.yaml @@ -16,7 +16,7 @@ - match: { _index: test_1 } - match: { _type: test } - - match: { _id: "1" } + - match: { _id: '1' } - match: { fields.foo: bar } - is_false: _source diff --git a/rest-api-spec/test/get_source/15_default_values.yaml b/rest-api-spec/test/get_source/15_default_values.yaml new file mode 100644 index 00000000000..cb2d4ed0b78 --- /dev/null +++ b/rest-api-spec/test/get_source/15_default_values.yaml @@ -0,0 +1,16 @@ +--- +"Default values": + + - do: + index: + index: test_1 + type: test + id: 1 + body: { "foo": "bar" } + + - do: + get_source: + index: test_1 + id: 1 + + - match: { '': { foo: bar } }