Module: ChatSDK::Testing::Helpers
- Defined in:
- lib/chat_sdk/testing/helpers.rb
Instance Method Summary collapse
- #build_bot(**options) ⇒ Object
- #build_card(title: "Test Card", &block) ⇒ Object
- #build_message(text: "hello", user_id: "U123", user_name: "testuser", channel_id: "C123", thread_id: "T123") ⇒ Object
- #fake_adapter ⇒ Object
Instance Method Details
#build_bot(**options) ⇒ Object
6 7 8 |
# File 'lib/chat_sdk/testing/helpers.rb', line 6 def build_bot(**) ChatSDK::Testing.build_bot(**) end |
#build_card(title: "Test Card", &block) ⇒ Object
26 27 28 |
# File 'lib/chat_sdk/testing/helpers.rb', line 26 def build_card(title: "Test Card", &block) ChatSDK.card(title: title, &block) end |
#build_message(text: "hello", user_id: "U123", user_name: "testuser", channel_id: "C123", thread_id: "T123") ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/chat_sdk/testing/helpers.rb', line 14 def (text: "hello", user_id: "U123", user_name: "testuser", channel_id: "C123", thread_id: "T123") = Author.new(id: user_id, name: user_name, platform: :test) Message.new( id: "msg_#{rand(10000..99999)}", text: text, author: , thread_id: thread_id, channel_id: channel_id, platform: :test ) end |
#fake_adapter ⇒ Object
10 11 12 |
# File 'lib/chat_sdk/testing/helpers.rb', line 10 def fake_adapter @fake_adapter ||= FakeAdapter.new end |