lita-updates 0.1.0 → 0.1.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
  SHA256:
3
- metadata.gz: 4002e96a6a90ba0eafed7aa75e9233e4039f3e538c4dcd4dd5df07b4d07650b7
4
- data.tar.gz: 2491be7eb80850c67c526c7f845e06e002353ff37ec35d747555591a14335c83
3
+ metadata.gz: f59397eb1fbff658f077c1c81afa18e2e28b8bd59de16e6fdc6808e96880a366
4
+ data.tar.gz: c9727618ed475f9466466ed3441f9497b78d03bd24b2fc8fd549ffddab7b2c2e
5
5
  SHA512:
6
- metadata.gz: 17fd7171e033c85d1ab6fd5193797e50b56300831cc0af4167ae6d9e5cc2efa1fa5810f2bcca447898421dc7929a35928ff4a66d7d204a947cb07e976252f780
7
- data.tar.gz: cd26cbda7e97ea4e56d3db8c822e11ec043c269ad44e701bf775b7483df4b7867102691805ba7d3b12173b2eb310a720c7b9e59d2d3279fee6a7dd5b7914e7b3
6
+ metadata.gz: 04f63295b844584c104fc48888d25223c774b3bc0fe55229ab878fe9bdede549ef369aa4a36a2a9b4950be992d36c498449122d46884b9767c22cb8e0c3732da
7
+ data.tar.gz: 9cb574c862db0c65ef3a7ad6d248127d163b5c02d5a28d0533062eba3cf263f7fb260d75b25e7b09b84193a584ca41db763829074e67366e15b831469a4cfeb1
@@ -1,6 +1,9 @@
1
1
  language: ruby
2
2
  rvm:
3
- - 2.0.0
3
+ - 2.2.10
4
+ - 2.3.7
5
+ - 2.4.4
6
+ - 2.5.1
4
7
  script: bundle exec rake
5
8
  before_install:
6
9
  - gem update --system
data/README.md CHANGED
@@ -1,5 +1,7 @@
1
1
  # lita-updates
2
2
 
3
+ [![Build Status](https://travis-ci.com/limbrapp/lita-updates.svg?branch=master)](https://travis-ci.com/limbrapp/lita-updates)
4
+
3
5
  Provides a structured standup discussion to share amongst team members, along with scheduling at specific times/days for each user.
4
6
 
5
7
  The original code for this library was constructed by [Josh Bassett](https://twitter.com/nullobject) and others at [The Conversation](https://theconversation.com/au), and then generously shared with myself to extend and open source.
@@ -26,7 +28,7 @@ This handler adds the following public commands via direct messages to your Lita
26
28
  If you want to get stuck into the internals of this handler, there are two hidden commands that may be useful:
27
29
 
28
30
  * `standup export` – returns the JSON of each person's schedules.
29
- * `standup import JSON` – sets up everyone's schedules. Don't use this command unless you're absolutely sure of what you're doing.
31
+ * `standup import JSON` – sets up everyone's schedules. Don't use this command unless you're absolutely sure of what you're doing (and [make sure smart quotes aren't enabled by your operating system](https://twitter.com/SlackHQ/status/898272637020852224)).
30
32
 
31
33
  ## Installation
32
34
 
@@ -7,7 +7,7 @@ Lita.load_locales Dir[File.expand_path(
7
7
 
8
8
  require "lita/handlers/updates"
9
9
 
10
- Lita::Handlers::Standup.template_root File.expand_path(
10
+ Lita::Handlers::Updates.template_root File.expand_path(
11
11
  File.join("..", "..", "templates"),
12
12
  __FILE__
13
13
  )
@@ -1,6 +1,6 @@
1
1
  module Lita
2
2
  module Handlers
3
- class Standup < Handler
3
+ class Updates < Handler
4
4
  MINUTE = 60 # seconds
5
5
 
6
6
  config :target
@@ -59,4 +59,4 @@ module Lita
59
59
  end
60
60
  end
61
61
 
62
- Lita.register_handler(Lita::Handlers::Standup)
62
+ Lita.register_handler(Lita::Handlers::Updates)
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |spec|
2
2
  spec.name = "lita-updates"
3
- spec.version = "0.1.0"
3
+ spec.version = "0.1.1"
4
4
  spec.authors = ["Pat Allan"]
5
5
  spec.email = ["pat@freelancing-gods.com"]
6
6
  spec.summary = "Standup Prompter for Slack"
@@ -1,4 +1,98 @@
1
1
  require "spec_helper"
2
2
 
3
- describe Lita::Handlers::Standup, lita_handler: true do
3
+ RSpec.describe Lita::Handlers::Updates, :lita_handler => true do
4
+ it "runs through the standup flow" do
5
+ send_command "standup", :privately => true
6
+
7
+ expect(replies.last).to include("time for our standup meeting")
8
+
9
+ send_message "many things", :privately => true
10
+
11
+ expect(replies.last).to include("What are you working on next?")
12
+
13
+ send_message "other things", :privately => true
14
+
15
+ expect(replies.last).to include("What blockers")
16
+
17
+ send_message "nothing much", :privately => true
18
+
19
+ expect(replies.last).to include("Test User posted a status update")
20
+ expect(replies.last).to include("What have you just been working on?")
21
+ end
22
+
23
+ it "skips answers of None" do
24
+ send_command "standup", :privately => true
25
+
26
+ expect(replies.last).to include("time for our standup meeting")
27
+
28
+ send_message "None", :privately => true
29
+
30
+ expect(replies.last).to include("What are you working on next?")
31
+
32
+ send_message "other things", :privately => true
33
+
34
+ expect(replies.last).to include("What blockers")
35
+
36
+ send_message "nothing much", :privately => true
37
+
38
+ expect(replies.last).to_not include("What have you just been working on?")
39
+ end
40
+
41
+ it "skips sharing when cancelled" do
42
+ send_command "standup", :privately => true
43
+
44
+ expect(replies.last).to include("time for our standup meeting")
45
+
46
+ send_message "many things", :privately => true
47
+
48
+ expect(replies.last).to include("What are you working on next?")
49
+
50
+ send_message "Cancel", :privately => true
51
+
52
+ expect(replies.last).to_not include("What blockers")
53
+ expect(replies.last).to_not include("Test User posted a status update")
54
+ end
55
+
56
+ it "allows for scheduling of standups" do
57
+ send_command "standup schedule 12:00 monday friday", :privately => true
58
+
59
+ expect(replies.last).
60
+ to include("Standup scheduled for 12:00 on monday, friday")
61
+ end
62
+
63
+ it "allows for clearing of schedules" do
64
+ send_command "standup schedule 12:00 monday friday", :privately => true
65
+ send_command "standup schedule clear", :privately => true
66
+
67
+ expect(replies.last).to include("No standup scheduled")
68
+ end
69
+
70
+ it "reports on the current schedule" do
71
+ send_command "standup schedule", :privately => true
72
+
73
+ expect(replies.last).to include("No standup scheduled")
74
+ end
75
+
76
+ it "can export schedules" do
77
+ send_command "standup schedule 12:00 monday friday", :privately => true
78
+ send_command "standup export", :privately => true
79
+
80
+ expect(replies.last).to include(
81
+ JSON.dump(
82
+ "Test User" => {"time" => "12:00", "days" => ["monday", "friday"]}
83
+ )
84
+ )
85
+ end
86
+
87
+ it "can import schedules" do
88
+ json = JSON.dump(
89
+ "Test User" => {"time" => "12:00", "days" => ["monday", "friday"]}
90
+ )
91
+
92
+ send_command "standup import #{json}", :privately => true
93
+ send_command "standup schedule", :privately => true
94
+
95
+ expect(replies.last).
96
+ to include("Standup scheduled for 12:00 on monday, friday")
97
+ end
4
98
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lita-updates
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pat Allan
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-05-15 00:00:00.000000000 Z
11
+ date: 2018-05-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: lita