test/embulk/input/zendesk/test_plugin.rb in embulk-input-zendesk-0.1.7 vs test/embulk/input/zendesk/test_plugin.rb in embulk-input-zendesk-0.1.8
- old
+ new
@@ -373,16 +373,18 @@
@httpclient.test_loopback_http_response << [
"HTTP/1.1 200",
"Content-Type: application/json",
"",
{
- tickets: tickets
+ tickets: tickets,
+ count: tickets.length,
}.to_json
].join("\r\n")
tickets.each do |ticket|
- mock(page_builder).add([ticket["id"]])
+ # schema[:columns] is id and tags. tags should be nil
+ mock(page_builder).add([ticket["id"], nil])
end
mock(page_builder).finish
@plugin.run
end
@@ -411,10 +413,11 @@
"Content-Type: application/json",
"",
{
ticket_events: events,
end_time: end_time,
+ count: events.length,
}.to_json
].join("\r\n")
stub(page_builder).add(anything)
stub(page_builder).finish
stub(Embulk).logger { Logger.new(File::NULL) }
@@ -450,10 +453,11 @@
@httpclient.test_loopback_http_response << [
"HTTP/1.1 200",
"Content-Type: application/json",
"",
{
- tickets: data
+ tickets: data,
+ count: data.length,
}.to_json
].join("\r\n")
end
def schema