lita-slack 1.7.1 → 1.7.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +1 -0
- data/lib/lita/adapters/slack/user_creator.rb +2 -5
- data/lita-slack.gemspec +1 -1
- data/spec/lita/adapters/slack/user_creator_spec.rb +4 -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: b66cc314ceaee4c634dd501c8a7913548f8c437b
|
4
|
+
data.tar.gz: 25e02797ea080058b6b149a6000f1aaa5366c840
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 96be42cc5971af17763d58f6a9ed7d48b47a7fcd5b766a5f0801c35445de9d4e00f988d5b7adb244745728541456f31ad1e4936c8a9c8a63e2484adb644e70d3
|
7
|
+
data.tar.gz: 3962f0e8955b7eb199e7c6017c560baaabcb87119262b95f79f1efc70d79c8bdde4eb9b25d2ea3e906e356359a7a427456a0efb3e474e6070c7294085835439b
|
data/.travis.yml
CHANGED
@@ -5,13 +5,10 @@ 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'] || {}
|
9
8
|
User.create(
|
10
9
|
slack_user.id,
|
11
|
-
|
12
|
-
|
13
|
-
mention_name: slack_user.name,
|
14
|
-
),
|
10
|
+
name: real_name(slack_user),
|
11
|
+
mention_name: slack_user.name
|
15
12
|
)
|
16
13
|
|
17
14
|
update_robot(robot, slack_user) if slack_user.id == robot_id
|
data/lita-slack.gemspec
CHANGED
@@ -16,14 +16,13 @@ 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, '
|
19
|
+
let(:slack_data) { { 'id' => 'U023BECGF', 'name' => 'bobby', 'real_name' => real_name, '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'
|
26
|
-
'email' => email,
|
25
|
+
mention_name: 'bobby'
|
27
26
|
)
|
28
27
|
expect(robot).to receive(:trigger).with(
|
29
28
|
:slack_user_created,
|
@@ -40,8 +39,7 @@ describe Lita::Adapters::Slack::UserCreator do
|
|
40
39
|
expect(Lita::User).to receive(:create).with(
|
41
40
|
'U023BECGF',
|
42
41
|
name: 'bobby',
|
43
|
-
mention_name: 'bobby'
|
44
|
-
'email' => email,
|
42
|
+
mention_name: 'bobby'
|
45
43
|
)
|
46
44
|
|
47
45
|
described_class.create_users([bobby], robot, robot_id)
|
@@ -51,7 +49,7 @@ describe Lita::Adapters::Slack::UserCreator do
|
|
51
49
|
|
52
50
|
describe ".create_user" do
|
53
51
|
let(:robot_id) { 'U12345678' }
|
54
|
-
let(:slack_data) { { 'id' => robot_id, 'name' => 'litabot', 'real_name' => 'Lita Bot', '
|
52
|
+
let(:slack_data) { { 'id' => robot_id, 'name' => 'litabot', 'real_name' => 'Lita Bot', 'email' => 'litabot@example.com' } }
|
55
53
|
let(:slack_user) { Lita::Adapters::Slack::SlackUser.new(robot_id, 'litabot', 'Lita Bot', slack_data) }
|
56
54
|
|
57
55
|
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.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: 2015-
|
12
|
+
date: 2015-11-17 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: eventmachine
|