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:
Родитель
ed4c691ba9
Коммит
d483bc3682
|
@ -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
|
||||
|
|
Загрузка…
Ссылка в новой задаче