lita-slack-standup 0.6.0 → 0.8.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +0 -1
- data/README.md +3 -5
- data/lib/lita/handlers/slack_standup.rb +29 -28
- data/lita-slack-standup.gemspec +1 -1
- data/locales/en.yml +26 -1
- data/locales/fr.yml +29 -0
- data/spec/lita/handlers/slack_standup_spec.rb +51 -29
- data/spec/spec_helper.rb +1 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 43edfae543811ccd70d702c6931abe461b45565a
|
4
|
+
data.tar.gz: d69d8432d34ea8835428a379b522e9abe8dad5f2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cbcb30a8b4d328926eb59d13028c5438430bcc00c549c49f788531cea77bccd8d12a015d3deb611bfc37567005824a2fb848fb0cdd3ccc843ab4b831c90846ff
|
7
|
+
data.tar.gz: 953ac35712b9e6a8811ec273fa4e94b42e97848533d82360f9c4ebc073182c3ce2905c2bcce40c696e44913bd59c55296bcbf0e6ca3a87023c2967c39b0b2516
|
data/.gitignore
CHANGED
data/README.md
CHANGED
@@ -1,7 +1,7 @@
|
|
1
|
-
# lita-
|
1
|
+
# lita-slack-standup
|
2
2
|
|
3
3
|
lita-slack-standup is a gem for Lita (https://www.lita.io/), a chat bot written in ruby.
|
4
|
-
It handles standup meetings on slack (
|
4
|
+
It handles standup meetings on slack (in english or french).
|
5
5
|
|
6
6
|
## Installation
|
7
7
|
|
@@ -16,12 +16,10 @@ gem "lita-standup"
|
|
16
16
|
In your lita configuration file (lita_config.rb), add the lines :
|
17
17
|
``` ruby
|
18
18
|
Lita.congifure do |config|
|
19
|
-
config.handlers.slack_standup.channel =
|
19
|
+
config.handlers.slack_standup.channel = <My standup channel name here>
|
20
20
|
end
|
21
21
|
```
|
22
22
|
|
23
|
-
And set the environment variable STANDUP_CHANNEL, with the name of the channel where you want to held the standup.
|
24
|
-
|
25
23
|
## Usage
|
26
24
|
|
27
25
|
- !standup start : launches the standup, prints the standups already filled and asks for someone else to report
|
@@ -5,80 +5,77 @@ module Lita
|
|
5
5
|
|
6
6
|
config :channel
|
7
7
|
|
8
|
-
|
8
|
+
def initialize(robot)
|
9
|
+
super
|
10
|
+
setup_redis_objects
|
11
|
+
end
|
12
|
+
|
13
|
+
route(/^standup\s+start$/, :standup_start, command: true, help: {t("help.start_cmd") => t("help.start_description") })
|
9
14
|
|
10
15
|
def standup_start(message=nil)
|
11
16
|
in_standup.value = 'true'
|
12
|
-
|
13
|
-
send_message(config.channel, 'Hello <!channel> ! Le standup va commencer : )')
|
17
|
+
send_message(config.channel, t("sentence.start"))
|
14
18
|
prewritten_standups_summary
|
15
19
|
standup_next
|
16
20
|
end
|
17
21
|
|
18
|
-
route(/\Astandup\s
|
22
|
+
route(/\Astandup\s+report\s*((.|\s)*)\z/, :standup_report, command: true, help: {t("help.report_cmd") => t("help.report_description")})
|
19
23
|
|
20
24
|
def standup_report(message)
|
21
|
-
setup_redis_objects
|
22
25
|
save_standup message
|
23
|
-
message.reply("
|
26
|
+
message.reply(t("sentence.report"))
|
24
27
|
end
|
25
28
|
|
26
|
-
route(/^standup\s
|
29
|
+
route(/^standup\s+next$/, :standup_next, command: true, help: {t("help.next_cmd") => t("help.next_description")})
|
27
30
|
|
28
31
|
def standup_next(message=nil)
|
29
|
-
setup_redis_objects
|
30
32
|
return unless standup_check?
|
31
33
|
|
32
34
|
if standup_members.none? { |user, standup| standup.empty? }
|
33
35
|
standup_end
|
34
36
|
else
|
35
37
|
next_attendee = select_next_standup
|
36
|
-
send_message(config.channel,"
|
38
|
+
send_message(config.channel, t("sentence.next", user: next_attendee))
|
37
39
|
fill_standup(next_attendee)
|
38
40
|
end
|
39
41
|
end
|
40
42
|
|
41
43
|
def reminder
|
42
|
-
setup_redis_objects
|
43
44
|
standup_members.each do |user, standup|
|
44
|
-
send_message("@#{user}","
|
45
|
+
send_message("@#{user}", t("sentence.reminder", user: user)) if standup.empty?
|
45
46
|
end
|
46
47
|
end
|
47
48
|
|
48
|
-
route(/^standup
|
49
|
+
route(/^standup\s+ignore\s*(.*)$/, :standup_ignore, command: true, help: {t("help.ignore_cmd") => t("help.ignore_description")})
|
49
50
|
|
50
51
|
def standup_ignore(message)
|
51
|
-
|
52
|
-
user = message.matches[0][0].gsub('@','')
|
52
|
+
user = extract_user(message)
|
53
53
|
|
54
54
|
unless ignored_members.include? user
|
55
55
|
ignored_members << user
|
56
56
|
standup_members.delete(user)
|
57
57
|
end
|
58
58
|
|
59
|
-
message.reply("
|
59
|
+
message.reply(t("sentence.ignore", user: user))
|
60
60
|
end
|
61
61
|
|
62
|
-
route(/^standup
|
62
|
+
route(/^standup\s+unignore\s*(.*)$/, :standup_unignore, command: true, help: {t("help.unignore_cmd") => t("help.unignore_description")})
|
63
63
|
|
64
64
|
def standup_unignore(message)
|
65
|
-
|
66
|
-
user = message.matches[0][0].gsub('@','')
|
65
|
+
user = extract_user(message)
|
67
66
|
|
68
67
|
if ignored_members.include? user
|
69
68
|
ignored_members.delete(user)
|
70
69
|
standup_members[user] = ''
|
71
70
|
end
|
72
71
|
|
73
|
-
message.reply("
|
72
|
+
message.reply(t("sentence.unignore",user: user))
|
74
73
|
end
|
75
74
|
|
76
|
-
route(/^standup\s
|
75
|
+
route(/^standup\s+list$/, :standup_list, command: true, help: {t("help.list_cmd") => t("help.list_description")})
|
77
76
|
|
78
77
|
def standup_list(message)
|
79
|
-
|
80
|
-
message.reply(
|
81
|
-
ignored_members.inject("Utilisateurs ignorés : ") do |reply, user|
|
78
|
+
message.reply(ignored_members.inject(t("sentence.list")) do |reply, user|
|
82
79
|
reply += "#{user} "
|
83
80
|
end
|
84
81
|
)
|
@@ -86,9 +83,13 @@ module Lita
|
|
86
83
|
|
87
84
|
private
|
88
85
|
|
86
|
+
def extract_user(message)
|
87
|
+
message.matches[0][0].gsub('@','')
|
88
|
+
end
|
89
|
+
|
89
90
|
def standup_check?
|
90
91
|
if in_standup.value != 'true'
|
91
|
-
send_message(config.channel,"
|
92
|
+
send_message(config.channel, t("sentence.next_forbidden"))
|
92
93
|
end
|
93
94
|
in_standup.value == 'true'
|
94
95
|
end
|
@@ -107,7 +108,7 @@ module Lita
|
|
107
108
|
end
|
108
109
|
|
109
110
|
def standup_members
|
110
|
-
@standup_members ||= Redis::HashKey.new('standup_members', redis
|
111
|
+
@standup_members ||= Redis::HashKey.new('standup_members', redis)
|
111
112
|
end
|
112
113
|
|
113
114
|
def retrieve_channel
|
@@ -147,7 +148,7 @@ module Lita
|
|
147
148
|
end
|
148
149
|
|
149
150
|
def display_standup(user, standup)
|
150
|
-
send_message(config.channel, "
|
151
|
+
send_message(config.channel, t("sentence.standup_done",{user: user, standup: standup}))
|
151
152
|
end
|
152
153
|
|
153
154
|
def save_standup(message)
|
@@ -157,7 +158,7 @@ module Lita
|
|
157
158
|
end
|
158
159
|
|
159
160
|
def fill_standup(member)
|
160
|
-
standup_members[member] =
|
161
|
+
standup_members[member] = t("sentence.standup_fill")
|
161
162
|
end
|
162
163
|
|
163
164
|
def select_next_standup
|
@@ -167,7 +168,7 @@ module Lita
|
|
167
168
|
def standup_end
|
168
169
|
in_standup.value = 'false'
|
169
170
|
|
170
|
-
send_message(config.channel,
|
171
|
+
send_message(config.channel,t("sentence.end_standup"))
|
171
172
|
|
172
173
|
update_standup_members
|
173
174
|
update_ids_to_members
|
data/lita-slack-standup.gemspec
CHANGED
data/locales/en.yml
CHANGED
@@ -1,4 +1,29 @@
|
|
1
1
|
en:
|
2
2
|
lita:
|
3
3
|
handlers:
|
4
|
-
|
4
|
+
slack_standup:
|
5
|
+
help:
|
6
|
+
start_cmd: standup start
|
7
|
+
start_description: Launches the standup, prints the standups already filled and asks for someone else to report
|
8
|
+
report_cmd: standup report TEXTE
|
9
|
+
report_description: Saves your standup. If you do it before the start of the standup, you won't be asked to report. The bot will displays your standup in your stead
|
10
|
+
next_cmd: standup next
|
11
|
+
next_description: Skips the current user and asks the next user to do his standup report
|
12
|
+
ignore_cmd: standup ignore USER
|
13
|
+
ignore_description: Ignores an user for the standups
|
14
|
+
unignore_cmd: standup unignore USER
|
15
|
+
unignore_description: Unignores an user
|
16
|
+
list_cmd: standup list
|
17
|
+
list_description: List all ignored users
|
18
|
+
sentence:
|
19
|
+
start: "Hello <!channel> ! The standup is starting :)"
|
20
|
+
report: "your standup is saved. Thanks :)"
|
21
|
+
next: "Good morning <@%{user}> ! It's your turn."
|
22
|
+
ignore: "<@%{user}> is now ignored."
|
23
|
+
reminder: "Good evening <@%{user}> ! You can write your standup for tomorrow !standup report hashtagmylife"
|
24
|
+
unignore: "<@%{user}> is now an attendee of the standups"
|
25
|
+
list: "Ignored users : "
|
26
|
+
next_forbidden: "The command is unavailable outside standups."
|
27
|
+
standup_done: "%{user} has already filled his standup: \n %{standup}"
|
28
|
+
standup_fill: "Standup done in live."
|
29
|
+
end_standup: "That's it ! It's all good for today. Thanks everyone :)"
|
data/locales/fr.yml
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
fr:
|
2
|
+
lita:
|
3
|
+
handlers:
|
4
|
+
slack_standup:
|
5
|
+
help:
|
6
|
+
start_cmd: standup start
|
7
|
+
start_description: Lance le standup
|
8
|
+
report_cmd: standup report TEXTE
|
9
|
+
report_description: Permet d'écrire son standup à l'avance ou pendant le tour d'un autre
|
10
|
+
next_cmd: standup next
|
11
|
+
next_description: Passe à l'utilisateur suivant et considère le standup précédent comme fait
|
12
|
+
ignore_cmd: standup ignore USER
|
13
|
+
ignore_description: Retire un utilisateur de la liste des personnes ayant à faire le standup
|
14
|
+
unignore_cmd: standup unignore USER
|
15
|
+
unignore_description: Remet l'utilisateur dans la liste des personnes participant aux standups
|
16
|
+
list_cmd: standup list
|
17
|
+
list_description: Liste les utilisateurs ignorés
|
18
|
+
sentence:
|
19
|
+
start: "Hello <!channel> ! Le standup va commencer :)"
|
20
|
+
report: "Ton standup est enregistré. Merci :)"
|
21
|
+
next: "Bonjour <@%{user}> ! C'est à ton tour de parler."
|
22
|
+
ignore: "<@%{user}> est désormais ignoré jusqu'à nouvel ordre."
|
23
|
+
reminder: "Bonsoir <@%{user}> ! Tu peux donner ton standup pour demain. !standup report 3615mavie"
|
24
|
+
unignore: "<@%{user}> est à nouveau inclus dans les standups."
|
25
|
+
list: "Utilisateurs ignorés : "
|
26
|
+
next_forbidden: "La commande n'est pas disponible en dehors d'un standup."
|
27
|
+
standup_done: "%{user} a déjà renseigné son standup : \n %{standup}"
|
28
|
+
standup_fill: "Standup fait en live."
|
29
|
+
end_standup: "Et voilà ! C'est bon pour aujourd'hui. Merci tout le monde :)"
|
@@ -1,14 +1,48 @@
|
|
1
1
|
require "spec_helper"
|
2
2
|
|
3
3
|
describe Lita::Handlers::SlackStandup, lita_handler: true do
|
4
|
-
|
5
4
|
let(:channel) { "#jambot-test" }
|
6
5
|
let(:robot_name) { "jambot-test" }
|
7
6
|
let(:sybil) { Lita::User.create(1000, name: "sybil") }
|
8
7
|
let(:zaratan) { Lita::User.create(1001, name: "zaratan") }
|
8
|
+
let(:header) {
|
9
|
+
{'Accept'=>'application/json; charset=utf-8',
|
10
|
+
'Accept-Encoding'=>'gzip;q=1.0,deflate;q=0.6,identity;q=0.3',
|
11
|
+
'Content-Type'=>'application/x-www-form-urlencoded',
|
12
|
+
'User-Agent'=>'Slack Ruby Client/0.6.0'}
|
13
|
+
}
|
9
14
|
|
10
15
|
let(:registry) do
|
11
16
|
reg = Lita::Registry.new
|
17
|
+
|
18
|
+
stub_request(:post, "https://slack.com/api/users.list").
|
19
|
+
with(:headers => header).
|
20
|
+
to_return(:status => 200, :body => '{"ok": true,"members":[{"id":"A","name":"sybil"}, {"id":"B","name":"zaratan"}]}', :headers => {})
|
21
|
+
|
22
|
+
stub_request(:post, "https://slack.com/api/channels.list").
|
23
|
+
with(:headers => header).
|
24
|
+
to_return(:status => 200, :body => '{"ok":true,"channels":[{"id":"C","name":"jambot-test","members":["B","A"],"num_members":2}]}', :headers => {})
|
25
|
+
|
26
|
+
stub_request(:post, "https://slack.com/api/chat.postMessage").
|
27
|
+
with(:body => {"as_user"=>"true", "channel"=>"#jambot-test", "text"=>"Hello <!channel> ! Le standup va commencer :)", "token"=>nil},:headers => header).
|
28
|
+
to_return(:status => 200, :body => '{"ok": true,"channel": "C","message": "Hello <!channel> ! Le standup va commencer :)"}', :headers => {})
|
29
|
+
|
30
|
+
stub_request(:post, "https://slack.com/api/chat.postMessage").
|
31
|
+
with(:body => {"as_user"=>"true", "channel"=>"#jambot-test", "text"=>"Bonjour <@zaratan> ! C'est à ton tour de parler.", "token"=>nil},:headers => header).
|
32
|
+
to_return(:status => 200, :body => '{"ok": true,"channel": "C","message": "Bonjour <@zaratan> ! C\'est à ton tour de parler."}', :headers => {})
|
33
|
+
|
34
|
+
stub_request(:post, "https://slack.com/api/chat.postMessage").
|
35
|
+
with(:body => {"as_user"=>"true", "channel"=>"#jambot-test", "text"=>"Bonjour <@sybil> ! C'est à ton tour de parler.", "token"=>nil},:headers => header).
|
36
|
+
to_return(:status => 200, :body => '{"ok": true,"channel": "C","message": "Bonjour <@sybil> ! C\'est à ton tour de parler."}', :headers => {})
|
37
|
+
|
38
|
+
stub_request(:post, "https://slack.com/api/chat.postMessage").
|
39
|
+
with(:body => {"as_user"=>"true", "channel"=>"#jambot-test", "text"=>"Et voilà ! C'est bon pour aujourd'hui. Merci tout le monde :)", "token"=>nil},:headers => header).
|
40
|
+
to_return(:status => 200, :body => '{"ok": true,"channel": "C","message": "Et voilà ! C\'est bon pour aujourd\'hui. Merci tout le monde :)"}', :headers => {})
|
41
|
+
|
42
|
+
stub_request(:post, "https://slack.com/api/chat.postMessage").
|
43
|
+
with(:body => {"as_user"=>"true", "channel"=>"#jambot-test", "text"=>"La commande n'est pas disponible en dehors d'un standup.", "token"=>nil},:headers => header).
|
44
|
+
to_return(:status => 200, :body => '{"ok": true,"channel": "C","message": "La commande n\'est pas disponible en dehors d\'un standup."}', :headers => {})
|
45
|
+
|
12
46
|
reg.register_handler(Lita::Handlers::SlackStandup)
|
13
47
|
|
14
48
|
reg.configure do |config|
|
@@ -26,23 +60,6 @@ describe Lita::Handlers::SlackStandup, lita_handler: true do
|
|
26
60
|
standup.send(:standup_members).clear
|
27
61
|
standup.send(:ids_to_members).clear
|
28
62
|
standup.send(:ignored_members).clear
|
29
|
-
|
30
|
-
stub_request(:post, "https://slack.com/api/users.list").
|
31
|
-
with(:body => {"token"=>nil}, :headers => {'Accept'=>'application/json; charset=utf-8', 'Accept-Encoding'=>'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Content-Type'=>'application/x-www-form-urlencoded', 'User-Agent'=>'Slack Ruby Client/0.6.0'}).
|
32
|
-
to_return(:status => 200, :body => '{"ok": true,"members":[
|
33
|
-
{"id":"A","team_id":"AT","name":"sybil"}, {"id":"B","team_id":"BT","name":"zaratan"}]}', :headers => {})
|
34
|
-
|
35
|
-
stub_request(:post, "https://slack.com/api/channels.list").
|
36
|
-
with(:body => {"token"=>nil},:headers => {'Accept'=>'application/json; charset=utf-8', 'Accept-Encoding'=>'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Content-Type'=>'application/x-www-form-urlencoded', 'User-Agent'=>'Slack Ruby Client/0.6.0'}).
|
37
|
-
to_return(:status => 200, :body => '{"ok":true,"channels":[{"id":"C","name":"jambot-test","is_channel":true,"members":["B","A"],"num_members":2}]}', :headers => {})
|
38
|
-
|
39
|
-
stub_request(:post, "https://slack.com/api/chat.postMessage").
|
40
|
-
with(:body => {"as_user"=>"true", "channel"=>"#jambot-test", "text"=>"Hello <!channel> ! Le standup va commencer : )", "token"=>nil},:headers => {'Accept'=>'application/json; charset=utf-8', 'Accept-Encoding'=>'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Content-Type'=>'application/x-www-form-urlencoded', 'User-Agent'=>'Slack Ruby Client/0.6.0'}).
|
41
|
-
to_return(:status => 200, :body => '{"ok": true,"channel": "C","message": "Hello <!channel> ! Le standup va commencer : )"}', :headers => {})
|
42
|
-
|
43
|
-
stub_request(:post, "https://slack.com/api/chat.postMessage").
|
44
|
-
with(:body => {"as_user"=>"true", "channel"=>"#jambot-test", "text"=>"Bonjour <@zaratan> ! C'est à ton tour de parler.", "token"=>nil},:headers => {'Accept'=>'application/json; charset=utf-8', 'Accept-Encoding'=>'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Content-Type'=>'application/x-www-form-urlencoded', 'User-Agent'=>'Slack Ruby Client/0.6.0'}).
|
45
|
-
to_return(:status => 200, :body => '{"ok": true,"channel": "C","message": "Bonjour <@zaratan> ! C\'est à ton tour de parler."}', :headers => {})
|
46
63
|
end
|
47
64
|
|
48
65
|
|
@@ -51,11 +68,10 @@ describe Lita::Handlers::SlackStandup, lita_handler: true do
|
|
51
68
|
send_message("!standup start", as: sybil, from: channel)
|
52
69
|
end
|
53
70
|
|
54
|
-
it { is_expected.to route("!standup start") }
|
71
|
+
it { is_expected.to route("!standup start") }
|
55
72
|
|
56
73
|
it "starts standup" do
|
57
|
-
|
58
|
-
[ "Hello <!channel> ! Le standup va commencer : )",
|
74
|
+
[ "Hello <!channel> ! Le standup va commencer :)",
|
59
75
|
"Bonjour <@zaratan> ! C'est à ton tour de parler."
|
60
76
|
].each do |text|
|
61
77
|
expect_any_instance_of(Slack::Web::Client).to receive(:chat_postMessage).with({:channel=>channel, :text=>text, :as_user=>true})
|
@@ -70,7 +86,7 @@ describe Lita::Handlers::SlackStandup, lita_handler: true do
|
|
70
86
|
end
|
71
87
|
|
72
88
|
it "displays known reports" do
|
73
|
-
[ "Hello <!channel> ! Le standup va commencer :
|
89
|
+
[ "Hello <!channel> ! Le standup va commencer :)",
|
74
90
|
"sybil a déjà renseigné son standup : \n My standup report for testing purposes",
|
75
91
|
"Bonjour <@zaratan> ! C'est à ton tour de parler."
|
76
92
|
].each do |text|
|
@@ -86,10 +102,10 @@ describe Lita::Handlers::SlackStandup, lita_handler: true do
|
|
86
102
|
end
|
87
103
|
|
88
104
|
it "displays the standups and ends the meeting" do
|
89
|
-
[ "Hello <!channel> ! Le standup va commencer :
|
105
|
+
[ "Hello <!channel> ! Le standup va commencer :)",
|
90
106
|
"zaratan a déjà renseigné son standup : \n My standup report for testing purposes",
|
91
107
|
"sybil a déjà renseigné son standup : \n My standup report for testing purposes",
|
92
|
-
"Et voilà ! C'est bon pour aujourd'hui. Merci tout le monde :
|
108
|
+
"Et voilà ! C'est bon pour aujourd'hui. Merci tout le monde :)"
|
93
109
|
].each do |text|
|
94
110
|
expect_any_instance_of(Slack::Web::Client).to receive(:chat_postMessage).with({:channel=>channel, :text=>text, :as_user=>true})
|
95
111
|
end
|
@@ -104,17 +120,21 @@ describe Lita::Handlers::SlackStandup, lita_handler: true do
|
|
104
120
|
send_message("!standup report My standup report for testing purposes", as: sybil, from: channel)
|
105
121
|
end
|
106
122
|
|
123
|
+
it { is_expected.to route("!standup report") }
|
124
|
+
|
107
125
|
it "saves the report" do
|
108
126
|
subject
|
109
127
|
expect(replies.last).to eq("Ton standup est enregistré. Merci :)")
|
110
128
|
end
|
111
129
|
end
|
112
130
|
|
113
|
-
describe "!standup
|
131
|
+
describe "!standup next command" do
|
114
132
|
subject do
|
115
133
|
send_message("!standup next", as: sybil, from: channel)
|
116
134
|
end
|
117
135
|
|
136
|
+
it { is_expected.to route("!standup next") }
|
137
|
+
|
118
138
|
context "when its called oustide of standups" do
|
119
139
|
it "is not available" do
|
120
140
|
expect_any_instance_of(Slack::Web::Client).to receive(:chat_postMessage).with({:channel=>channel, :text=>"La commande n'est pas disponible en dehors d'un standup.", :as_user=>true})
|
@@ -135,25 +155,25 @@ describe Lita::Handlers::SlackStandup, lita_handler: true do
|
|
135
155
|
end
|
136
156
|
|
137
157
|
describe "!standup ignore user command" do
|
138
|
-
|
139
158
|
before do
|
140
159
|
send_message("!standup start", as: sybil, from: channel)
|
141
160
|
end
|
142
161
|
|
143
162
|
subject do
|
144
163
|
send_message("!standup ignore sybil", as: sybil, from: channel)
|
145
|
-
send_message("!standup next
|
164
|
+
send_message("!standup next", as: sybil, from: channel)
|
146
165
|
end
|
147
166
|
|
167
|
+
it { is_expected.to route("!standup ignore") }
|
168
|
+
|
148
169
|
it "ignores an user" do
|
149
|
-
expect_any_instance_of(Slack::Web::Client).to receive(:chat_postMessage).with({:channel=>channel, :text=>"Et voilà ! C'est bon pour aujourd'hui. Merci tout le monde :
|
170
|
+
expect_any_instance_of(Slack::Web::Client).to receive(:chat_postMessage).with({:channel=>channel, :text=>"Et voilà ! C'est bon pour aujourd'hui. Merci tout le monde :)", :as_user=>true})
|
150
171
|
subject
|
151
172
|
expect(replies.last).to eq("<@sybil> est désormais ignoré jusqu'à nouvel ordre.")
|
152
173
|
end
|
153
174
|
end
|
154
175
|
|
155
176
|
describe "!standup unignore user command" do
|
156
|
-
|
157
177
|
before do
|
158
178
|
send_message("!standup start", as: sybil, from: channel)
|
159
179
|
send_message("!standup ignore sybil", as: sybil, from: channel)
|
@@ -164,6 +184,8 @@ describe Lita::Handlers::SlackStandup, lita_handler: true do
|
|
164
184
|
send_message("!standup next", as: sybil, from: channel)
|
165
185
|
end
|
166
186
|
|
187
|
+
it { is_expected.to route("!standup unignore") }
|
188
|
+
|
167
189
|
it "unignores an user" do
|
168
190
|
expect_any_instance_of(Slack::Web::Client).to receive(:chat_postMessage).with({:channel=>channel, :text=>"Bonjour <@sybil> ! C'est à ton tour de parler.", :as_user=>true})
|
169
191
|
subject
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lita-slack-standup
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.8.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sybil Deboin
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-03-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: lita
|
@@ -139,6 +139,7 @@ files:
|
|
139
139
|
- lib/slack_client.rb
|
140
140
|
- lita-slack-standup.gemspec
|
141
141
|
- locales/en.yml
|
142
|
+
- locales/fr.yml
|
142
143
|
- spec/lita/handlers/slack_standup_spec.rb
|
143
144
|
- spec/spec_helper.rb
|
144
145
|
- templates/.gitkeep
|