[TEST] move test for binary field to specific test file that sets Content-Type header explicitly

This commit is contained in:
javanna 2017-02-20 12:17:30 +01:00 committed by Luca Cavanna
parent 261f31f5b7
commit dad025a6ad
2 changed files with 47 additions and 24 deletions

View File

@ -6,9 +6,6 @@ setup:
mappings: mappings:
test: test:
properties: properties:
binary:
type: binary
doc_values: true
boolean: boolean:
type: boolean type: boolean
date: date:
@ -46,7 +43,6 @@ setup:
type: test type: test
id: 1 id: 1
body: body:
binary: U29tZSBiaW5hcnkgYmxvYg==
boolean: true boolean: true
date: 2017-01-01T12:11:12 date: 2017-01-01T12:11:12
geo_point: 41.12,-71.34 geo_point: 41.12,-71.34
@ -65,26 +61,6 @@ setup:
- do: - do:
indices.refresh: {} indices.refresh: {}
---
"binary":
- do:
search:
body:
script_fields:
field:
script:
inline: "doc['binary'].get(0).utf8ToString()"
- match: { hits.hits.0.fields.field.0: "Some binary blob" }
- do:
search:
body:
script_fields:
field:
script:
inline: "doc['binary'].value.utf8ToString()"
- match: { hits.hits.0.fields.field.0: "Some binary blob" }
--- ---
"boolean": "boolean":
- do: - do:

View File

@ -0,0 +1,47 @@
---
"binary":
- skip:
features: ["headers"]
- do:
indices.create:
index: test
body:
mappings:
test:
properties:
binary:
type: binary
doc_values: true
- do:
#set the header so we won't randomize it
headers:
Content-Type: application/json
index:
index: test
type: test
id: 1
body:
binary: U29tZSBiaW5hcnkgYmxvYg==
- do:
indices.refresh: {}
- do:
search:
body:
script_fields:
field:
script:
inline: "doc['binary'].get(0).utf8ToString()"
- match: { hits.hits.0.fields.field.0: "Some binary blob" }
- do:
search:
body:
script_fields:
field:
script:
inline: "doc['binary'].value.utf8ToString()"
- match: { hits.hits.0.fields.field.0: "Some binary blob" }