Module: Bot::Rspec::Syntax

Included in:
Bot::Rspec
Defined in:
lib/bot/rspec/syntax.rb

Instance Method Summary collapse

Instance Method Details

#incoming_message(from, options = {}) ⇒ Object



4
5
6
7
8
9
10
11
12
13
# File 'lib/bot/rspec/syntax.rb', line 4

def incoming_message(from, options={})
  {
    "from" => from,
    "body" => "No Message",
    "readReceiptRequested" => true,
    "timestamp" => Time.now.to_i * 1000,
    "type" => "text",
    "id" => "07c6eb77-e01c-439a-80e7-3583dd784de1"
  }.merge(options.stringify_keys)
end

#incoming_scan(from, options = {}) ⇒ Object



15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/bot/rspec/syntax.rb', line 15

def incoming_scan(from, options={})
  {
    "from" => from,
    "timestamp" => 1457449114952,
    "data" => "{}",
    "mention" => nil,
    "participants" => [from],
    "readReceiptRequested" => false,
    "type" => "scan-data",
    "id" => "e6303158-ca60-4332-a600-236c5de4fedb",
    "chatId" => "d68a7ab10a1526ac9682b764e2784080bb1cb52fc82c8f9c10c7d0534741fc93"
  }.merge(options.stringify_keys)
end

#outgoing_message(to, options = {}) ⇒ Object



29
30
31
32
33
34
35
36
# File 'lib/bot/rspec/syntax.rb', line 29

def outgoing_message(to, options={})
  {
    "to" => to,
    "body" => "No Message",
    "type" => "text",
    "typeTime" => 0
  }.merge(options.stringify_keys)
end