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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d7f1d225202b65d41b80a2af027ee53b4a8baecc
4
- data.tar.gz: 48d2cef96f1525da61493f2dfcde001a9bd622b9
3
+ metadata.gz: 0740523cfe333666a4282c857a57f1fbd479de0e
4
+ data.tar.gz: f6844c11139c5a339ff0868fea8d7c31af6fda5a
5
5
  SHA512:
6
- metadata.gz: 56a16eb174fae560634fe4782db485c4941a5a9cbb2403937fdc1a7e983130874004de665b823999492ad0c13ef230280f7caa2e3c552da76247c437ca83a73c
7
- data.tar.gz: eee55ad67b36f83d2fc228ebd0f1d0ce7ab3782c6a58001cc1d4a0ef7834f4364b1052d2de8b50582926097dc8ae83b5cca02287adaa3263caa240466435cfa5
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/bot.
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
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |spec|
2
2
  spec.name = "lita-slack"
3
- spec.version = "1.0.1"
3
+ spec.version = "1.0.2"
4
4
  spec.authors = ["Ken J.", "Jimmy Cuadra"]
5
5
  spec.email = ["kenjij@gmail.com", "jimmy@jimmycuadra.com"]
6
6
  spec.description = %q{Lita adapter for Slack.}
@@ -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" => "some user data"
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 |user_data, robot, robot_id|
120
- expect(user_data).to eq("some user data")
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" => "some user data"
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 |user_data, robot, robot_id|
139
- expect(user_data).to eq("some user data")
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.1
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-10 00:00:00.000000000 Z
12
+ date: 2014-12-12 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: eventmachine