Emulate the reference hubot-chatops-rpc implementation

The reference hubot chatops-rpc implementation has the generic arguments
(--param value) overwriting the parameter values extracted via the
regular expression parsing. The change to the test here emulates that
behavior.

refs d32d185f63/src/chatops-rpc.coffee (L250-L253)
This commit is contained in:
Tim Pease 2018-09-19 12:54:45 -06:00
Родитель ed4c691ba9
Коммит d483bc3682
1 изменённых файлов: 1 добавлений и 1 удалений

Просмотреть файл

@ -57,7 +57,7 @@ module Chatops::Controller::TestCaseHelpers
match_data = matcher["regex"].match(command)
jsonrpc_params = named_params.dup
matcher["params"].each do |param|
jsonrpc_params[param] = match_data[param.to_sym]
jsonrpc_params[param] ||= match_data[param.to_sym]
end
jsonrpc_params.merge!(user: user, room_id: room_id, mention_slug: user)
chatop matcher["name"].to_sym, jsonrpc_params