lita-slack 1.0.1 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/lita/adapters/slack/message_handler.rb +2 -2
- data/lita-slack.gemspec +1 -1
- data/spec/lita/adapters/slack/message_handler_spec.rb +14 -6
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0740523cfe333666a4282c857a57f1fbd479de0e
|
4
|
+
data.tar.gz: f6844c11139c5a339ff0868fea8d7c31af6fda5a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fd4fd75c42927c27ae47a0cc6ef639811d41f3c8130753c75c17f5978180710174f23714076b982e6ec8612b28a36c72bee927db58b6b737d10b3fc9da2e611c
|
7
|
+
data.tar.gz: 6a65d3c4e437d32d8fe654fbfd886c728a11311645a31c5a94e774176b3e946ecf49d42ac7d33bbcc93a937a4291486009f5c805ff976946fa25350054458d23
|
data/README.md
CHANGED
@@ -14,7 +14,7 @@ gem "lita-slack"
|
|
14
14
|
|
15
15
|
### Required attributes
|
16
16
|
|
17
|
-
* `token` (String) – The bot's Slack API token. Create a bot and get its token at https://my.slack.com/services/new/
|
17
|
+
* `token` (String) – The bot's Slack API token. Create a bot and get its token at https://my.slack.com/services/new/lita.
|
18
18
|
|
19
19
|
**Note**: When using lita-slack, the adapter will overwrite the bot's name and mention name with the values set on the server, so `config.robot.name` and `config.robot.mention_name` will have no effect.
|
20
20
|
|
@@ -58,7 +58,7 @@ module Lita
|
|
58
58
|
|
59
59
|
def handle_bot_change
|
60
60
|
log.debug("Updating user data for bot.")
|
61
|
-
UserCreator.create_user(data["bot"], robot, robot_id)
|
61
|
+
UserCreator.create_user(SlackUser.from_data(data["bot"]), robot, robot_id)
|
62
62
|
end
|
63
63
|
|
64
64
|
def handle_error
|
@@ -91,7 +91,7 @@ module Lita
|
|
91
91
|
|
92
92
|
def handle_user_change
|
93
93
|
log.debug("Updating user data.")
|
94
|
-
UserCreator.create_user(data["user"], robot, robot_id)
|
94
|
+
UserCreator.create_user(SlackUser.from_data(data["user"]), robot, robot_id)
|
95
95
|
end
|
96
96
|
|
97
97
|
def log
|
data/lita-slack.gemspec
CHANGED
@@ -106,18 +106,23 @@ describe Lita::Adapters::Slack::MessageHandler, lita: true do
|
|
106
106
|
end
|
107
107
|
|
108
108
|
context "with a team join message" do
|
109
|
+
# let(:bobby) { Lita::Adapters::Slack::SlackUser.new('U023BECGF', 'bobby', real_name) }
|
109
110
|
let(:data) do
|
110
111
|
{
|
111
112
|
"type" => "team_join",
|
112
|
-
"user" =>
|
113
|
+
"user" => {
|
114
|
+
"id" => "U023BECGF",
|
115
|
+
"name" => "bobby",
|
116
|
+
"real_name" => "Bobby Tables"
|
117
|
+
}
|
113
118
|
}
|
114
119
|
end
|
115
120
|
|
116
121
|
it "creates the new user" do
|
117
122
|
expect(
|
118
123
|
Lita::Adapters::Slack::UserCreator
|
119
|
-
).to receive(:create_user) do |
|
120
|
-
expect(
|
124
|
+
).to receive(:create_user) do |slack_user, robot, robot_id|
|
125
|
+
expect(slack_user.name).to eq("bobby")
|
121
126
|
end
|
122
127
|
|
123
128
|
subject.handle
|
@@ -128,15 +133,18 @@ describe Lita::Adapters::Slack::MessageHandler, lita: true do
|
|
128
133
|
let(:data) do
|
129
134
|
{
|
130
135
|
"type" => "bot_added",
|
131
|
-
"bot" =>
|
136
|
+
"bot" => {
|
137
|
+
"id" => "U01234567",
|
138
|
+
"name" => "foobot"
|
139
|
+
}
|
132
140
|
}
|
133
141
|
end
|
134
142
|
|
135
143
|
it "creates a new user for the bot" do
|
136
144
|
expect(
|
137
145
|
Lita::Adapters::Slack::UserCreator
|
138
|
-
).to receive(:create_user) do |
|
139
|
-
expect(
|
146
|
+
).to receive(:create_user) do |slack_user, robot, robot_id|
|
147
|
+
expect(slack_user.name).to eq("foobot")
|
140
148
|
end
|
141
149
|
|
142
150
|
subject.handle
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lita-slack
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ken J.
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-12-
|
12
|
+
date: 2014-12-12 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: eventmachine
|