lita-slack 1.7.0 → 1.7.1
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 680aa1ce2ff510edb1eb9ec93d32226d3a3baac0
|
4
|
+
data.tar.gz: 71931fedbc7d245b65c1c0ba59d520f382b94fe4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d16b1e01202a413d9c5b738a969cc7fe4250a55c57210a274cd4a57813a96709a827f039720606eb366907add758bc262ce3c2096f843f87c72e6601e48ccbd4
|
7
|
+
data.tar.gz: cb4446da0ea80f6dcd848861411d99703c7810e765ce8ff6511be0272fd596162671936145bdfb09b7fde711ab75989e13eb4b2b53e7b84b803bac7d3a039898
|
@@ -5,10 +5,13 @@ module Lita
|
|
5
5
|
class UserCreator
|
6
6
|
class << self
|
7
7
|
def create_user(slack_user, robot, robot_id)
|
8
|
+
profile = slack_user.metadata['profile'] || {}
|
8
9
|
User.create(
|
9
10
|
slack_user.id,
|
10
|
-
|
11
|
-
|
11
|
+
profile.merge(
|
12
|
+
name: real_name(slack_user),
|
13
|
+
mention_name: slack_user.name,
|
14
|
+
),
|
12
15
|
)
|
13
16
|
|
14
17
|
update_robot(robot, slack_user) if slack_user.id == robot_id
|
data/lita-slack.gemspec
CHANGED
@@ -16,13 +16,14 @@ describe Lita::Adapters::Slack::UserCreator do
|
|
16
16
|
let(:email) { 'bobby@example.com' }
|
17
17
|
let(:bobby) { Lita::Adapters::Slack::SlackUser.new('U023BECGF', 'bobby', real_name, slack_data) }
|
18
18
|
let(:robot_id) { 'U12345678' }
|
19
|
-
let(:slack_data) { { 'id' => 'U023BECGF', 'name' => 'bobby', 'real_name' => real_name, 'email' => email } }
|
19
|
+
let(:slack_data) { { 'id' => 'U023BECGF', 'name' => 'bobby', 'real_name' => real_name, 'profile' => { 'email' => email } } }
|
20
20
|
|
21
21
|
it "creates Lita users for each user in the provided data" do
|
22
22
|
expect(Lita::User).to receive(:create).with(
|
23
23
|
'U023BECGF',
|
24
24
|
name: 'Bobby Tables',
|
25
|
-
mention_name: 'bobby'
|
25
|
+
mention_name: 'bobby',
|
26
|
+
'email' => email,
|
26
27
|
)
|
27
28
|
expect(robot).to receive(:trigger).with(
|
28
29
|
:slack_user_created,
|
@@ -39,7 +40,8 @@ describe Lita::Adapters::Slack::UserCreator do
|
|
39
40
|
expect(Lita::User).to receive(:create).with(
|
40
41
|
'U023BECGF',
|
41
42
|
name: 'bobby',
|
42
|
-
mention_name: 'bobby'
|
43
|
+
mention_name: 'bobby',
|
44
|
+
'email' => email,
|
43
45
|
)
|
44
46
|
|
45
47
|
described_class.create_users([bobby], robot, robot_id)
|
@@ -49,7 +51,7 @@ describe Lita::Adapters::Slack::UserCreator do
|
|
49
51
|
|
50
52
|
describe ".create_user" do
|
51
53
|
let(:robot_id) { 'U12345678' }
|
52
|
-
let(:slack_data) { { 'id' => robot_id, 'name' => 'litabot', 'real_name' => 'Lita Bot', 'email' => 'litabot@example.com' } }
|
54
|
+
let(:slack_data) { { 'id' => robot_id, 'name' => 'litabot', 'real_name' => 'Lita Bot', 'profile' => { 'email' => 'litabot@example.com' } } }
|
53
55
|
let(:slack_user) { Lita::Adapters::Slack::SlackUser.new(robot_id, 'litabot', 'Lita Bot', slack_data) }
|
54
56
|
|
55
57
|
it "updates the robot's name and mention name if it applicable" do
|
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.7.
|
4
|
+
version: 1.7.1
|
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: 2015-
|
12
|
+
date: 2015-10-31 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: eventmachine
|