Module: TelegramActionExampleGroup::InstanceMethods

Defined in:
lib/telegram_workflow/rspec.rb

Instance Method Summary collapse

Instance Method Details

#send_message(message_text: "", callback_data: "", inline_data: "") {|action_params| ... } ⇒ Object

Yields:

  • (action_params)


39
40
41
42
43
44
45
46
47
48
49
# File 'lib/telegram_workflow/rspec.rb', line 39

def send_message(message_text: "", callback_data: "", inline_data: "")
  action_params["message"]["text"] = message_text
  action_params["callback_query"]["data"] = callback_data
  action_params["inline_query"]["query"] = inline_data
  yield action_params if block_given?

  workflow = TestFlow.new(action_params)
  workflow.example_group = self

  workflow.process
end