Skip to content

Commit ceb7abe

Browse files
committed
[API] Test Runner: Refactors how bulk body is sent for more consistency
1 parent 80fd9d2 commit ceb7abe

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

api-spec-testing/test_file/action.rb

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,17 @@ def execute(client, test = nil)
6767

6868
_method = chain[-1]
6969
case _method
70+
when 'bulk'
71+
arguments = prepare_arguments(args, test)
72+
arguments[:body].map! do |item|
73+
if item.is_a?(Hash)
74+
item
75+
elsif item.is_a?(String)
76+
symbolize_keys(JSON.parse(item))
77+
end
78+
end if arguments[:body].is_a? Array
79+
@response = client.send(_method, arguments)
80+
client
7081
when 'headers'
7182
headers = prepare_arguments(args, test)
7283
# TODO: Remove Authorization headers while x_pack_rest_user is fixed

0 commit comments

Comments
 (0)