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: 5ef23fe9c0c94ca5668f7780c8504e0d695d896e
4
- data.tar.gz: fe0565d87688f3f175a4f6c50410b4c9e9a65ecf
3
+ metadata.gz: 680aa1ce2ff510edb1eb9ec93d32226d3a3baac0
4
+ data.tar.gz: 71931fedbc7d245b65c1c0ba59d520f382b94fe4
5
5
  SHA512:
6
- metadata.gz: 2e9243b224e1bb78f731707496200bb34dcebf0bea6cb6ed9ae3a8e208c2ff6781f96cc32e7f955f790df9b00348355cc73038b72e4bfa30d6cd766ae007b19b
7
- data.tar.gz: be29248c5356c227b17877135dc2fc0e471c057b11eb4868238a09b6b1712a017ab619155e3eeb955d4dc5a7c9cd20a9b23383968083588427032ac8922a4b5c
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
- name: real_name(slack_user),
11
- mention_name: slack_user.name
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
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |spec|
2
2
  spec.name = "lita-slack"
3
- spec.version = "1.7.0"
3
+ spec.version = "1.7.1"
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.}
@@ -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.0
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-09-25 00:00:00.000000000 Z
12
+ date: 2015-10-31 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: eventmachine