Class: Komonjo::Mock::SlackMock
- Inherits:
-
Object
- Object
- Komonjo::Mock::SlackMock
- Defined in:
- lib/komonjo/mocks/slack_mock.rb
Overview
Mock for SlackConnection
Class Method Summary collapse
- .channels_history(channel_name) ⇒ Object
- .channels_list ⇒ Object
- .chat_logs ⇒ Object
- .emoji_list(opts = {}) ⇒ Object
- .users_list ⇒ Object
Class Method Details
.channels_history(channel_name) ⇒ Object
20 21 22 23 24 25 |
# File 'lib/komonjo/mocks/slack_mock.rb', line 20 def channels_history(channel_name) [{ type: 'message', user: 'id001', channel: channel_name, text: '<@id001> hello :bow:' }, { type: 'message', user: 'id002', channel: channel_name, text: 'This is Komonjo' }] end |
.channels_list ⇒ Object
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 |
# File 'lib/komonjo/mocks/slack_mock.rb', line 27 def channels_list [{ 'id': 'C024BE91L', 'name': 'channel1', 'is_channel': 'true', 'created': 1_360_782_804, 'creator': 'U024BE7LH', 'is_archived': false, 'is_general': false, 'members': %w(U024BE7LH U024BE7LH), 'topic': { 'value': 'Fun times', 'creator': 'U024BE7LV', 'last_set': 1_369_677_212 }, 'purpose': { 'value': 'This channel is for fun', 'creator': 'U024BE7LH', 'last_set': 1_360_782_804 }, 'is_member': true, 'last_read': '1401383885.000061', 'latest': { 'hoge': 'fuga' }, 'unread_count': 0, 'unread_count_display': 0 }, { 'id': 'C024BE91L', 'name': 'channel1', 'is_channel': 'true', 'created': 1_360_782_804, 'creator': 'U024BE7LH', 'is_archived': false, 'is_general': false, 'members': %w(U024BE7LH U024BE7LH), 'topic': { 'value': 'Fun times', 'creator': 'U024BE7LV', 'last_set': 1_369_677_212 }, 'purpose': { 'value': 'This channel is for fun', 'creator': 'U024BE7LH', 'last_set': 1_360_782_804 }, 'is_member': true, 'last_read': '1401383885.000061', 'latest': { 'hoge': 'fuga' }, 'unread_count': 0, 'unread_count_display': 0 }] end |
.chat_logs ⇒ Object
7 8 9 10 11 |
# File 'lib/komonjo/mocks/slack_mock.rb', line 7 def chat_logs g = Komonjo::Gateway::MessagesGateway.new(channels_history('test'), users_list) g. end |
.emoji_list(opts = {}) ⇒ Object
83 84 85 86 87 88 89 |
# File 'lib/komonjo/mocks/slack_mock.rb', line 83 def emoji_list(opts = {}) { "bowtie": "https:\/\/my.slack.com\/emoji\/bowtie\/46ec6f2bb0.png", "squirrel": "https:\/\/my.slack.com\/emoji\/squirrel\/f35f40c0e0.png", "shipit": "alias:squirrel", } end |
.users_list ⇒ Object
13 14 15 16 17 18 |
# File 'lib/komonjo/mocks/slack_mock.rb', line 13 def users_list [{ id: 'id001', name: 'name001', deleted: false, profile: { image_48: '' } }, { id: 'id002', name: 'name002', deleted: false, profile: { image_48: '' } }] end |