lita-slack-standup 0.3.0 → 0.5.0

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: 24837d008e9571abcfcefe9e4a6cd2769806d379
4
- data.tar.gz: 63f45bd81663b8258eb09a2050ff94f7ea18fc6a
3
+ metadata.gz: 13a8bd26d0513fbb89c7d2e2da9260382fe807c3
4
+ data.tar.gz: 77b75f0b5ac8943e58088151a3500ee480a4b458
5
5
  SHA512:
6
- metadata.gz: b48d26793feef58a92742badd7a532f01ee929cb73bc611acc6f09a0bd7925978110c7396bad59095222d9bb85ad05d82a334aa98c0fd5943dfcd344be90eb2f
7
- data.tar.gz: 44955b6360bf157e6133fdf7da8ce4cbc1772fd9f46d82eb4307c66baa507c9bcf4025b9fac82f8c5982b0329f328db7c52ee12a6e3296e1e75bf60e379f64bb
6
+ metadata.gz: 51473e6515c67ddff2ed08b93a426b6da14fc58727375942d2a8c9642526c11c72311572e268990101373843d717c9ac3f1f35cddc4ec6c7f085b44eb9fbd27e
7
+ data.tar.gz: 912ead65247840a1e91dbef8db7395954fd698f08a495861edb425111e2dda37b0dae1a6ebe9863cf6dd5e43d85712d37e6a390d999250b4ac64dc25a74c573d
data/README.md CHANGED
@@ -22,11 +22,6 @@ end
22
22
 
23
23
  And set the environment variable STANDUP_CHANNEL, with the name of the channel where you want to held the standup.
24
24
 
25
- ## Test
26
-
27
- We used VCR generated by real standups on slack. We had to delete them for privacy reasons.
28
- To rerun the tests and recreate some VCR, you need to bundle the gem into a lita bot.
29
-
30
25
  ## Usage
31
26
 
32
27
  - !standup start : launches the standup, prints the standups already filled and asks for someone else to report
@@ -1,10 +1,10 @@
1
1
  Gem::Specification.new do |spec|
2
2
  spec.name = "lita-slack-standup"
3
- spec.version = "0.3.0"
3
+ spec.version = "0.5.0"
4
4
  spec.authors = ["Sybil Deboin"]
5
5
  spec.email = ["sybil.deboin@gmail.com"]
6
6
  spec.description = "Standup feature for slack"
7
- spec.summary = ""
7
+ spec.summary = "A lita gem to enable standups on slack"
8
8
  spec.homepage = "https://github.com/blackbirdco/lita-slack-standup"
9
9
  spec.license = "GNU v3.0"
10
10
  spec.metadata = { "lita_plugin_type" => "handler" }
@@ -20,10 +20,7 @@ Gem::Specification.new do |spec|
20
20
  spec.add_runtime_dependency "redis-objects"
21
21
 
22
22
  spec.add_development_dependency "bundler", "~> 1.3"
23
- spec.add_development_dependency "pry-byebug"
24
23
  spec.add_development_dependency "rake"
25
- spec.add_development_dependency "rack-test"
26
24
  spec.add_development_dependency "rspec", ">= 3.0.0"
27
25
  spec.add_development_dependency "webmock"
28
- spec.add_development_dependency "vcr"
29
26
  end
@@ -7,25 +7,17 @@ describe Lita::Handlers::SlackStandup, lita_handler: true do
7
7
  let(:sybil) { Lita::User.create(1000, name: "sybil") }
8
8
  let(:zaratan) { Lita::User.create(1001, name: "zaratan") }
9
9
 
10
- before(:all) do
11
- Slack.configure do |config|
12
- config.token = ENV['SLACK_LITA_TOKEN']
13
- end
14
- Lita.configure do |config|
15
- config.handlers.slack_standup.channel = '#jambot-test'
16
- end
17
- end
18
-
19
10
  let(:registry) do
20
11
  reg = Lita::Registry.new
21
12
  reg.register_handler(Lita::Handlers::SlackStandup)
13
+
22
14
  reg.configure do |config|
23
15
  config.robot.name = robot_name
24
16
  config.robot.alias = "!"
25
17
  config.robot.adapter = :slack
26
18
  config.handlers.slack_standup.channel = channel
27
19
  end
28
-
20
+
29
21
  reg
30
22
  end
31
23
 
@@ -34,17 +26,35 @@ describe Lita::Handlers::SlackStandup, lita_handler: true do
34
26
  standup.send(:standup_members).clear
35
27
  standup.send(:ids_to_members).clear
36
28
  standup.send(:ignored_members).clear
37
- ['jambot','slackbot','sybil_test'].each do |ignored_member|
38
- standup.send(:ignored_members) << ignored_member
39
- end
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 => {})
40
46
  end
41
-
47
+
48
+
42
49
  describe "when standup starts" do
43
50
  subject do
44
51
  send_message("!standup start", as: sybil, from: channel)
45
52
  end
46
53
 
47
- it "starts standup", vcr: {cassette_name: 'standup_start'} do
54
+ it { is_expected.to route("!standup start") }
55
+
56
+ it "starts standup" do
57
+
48
58
  [ "Hello <!channel> ! Le standup va commencer : )",
49
59
  "Bonjour <@zaratan> ! C'est à ton tour de parler."
50
60
  ].each do |text|
@@ -59,29 +69,29 @@ describe Lita::Handlers::SlackStandup, lita_handler: true do
59
69
  send_message("!standup report My standup report for testing purposes", as: sybil, from: channel)
60
70
  end
61
71
 
62
- it "displays known reports", vcr: {cassette_name: 'standup_one_report_prefilled'} do
63
- [ "Hello <!channel> ! Le standup va commencer : )",
64
- "sybil a déjà renseigné son standup : \n My standup report for testing purposes",
65
- "Bonjour <@zaratan> ! C'est à ton tour de parler."
66
- ].each do |text|
67
- expect_any_instance_of(Slack::Web::Client).to receive(:chat_postMessage).with({:channel=>channel, :text=>text, :as_user=>true})
68
- end
72
+ it "displays known reports" do
73
+ [ "Hello <!channel> ! Le standup va commencer : )",
74
+ "sybil a déjà renseigné son standup : \n My standup report for testing purposes",
75
+ "Bonjour <@zaratan> ! C'est à ton tour de parler."
76
+ ].each do |text|
77
+ expect_any_instance_of(Slack::Web::Client).to receive(:chat_postMessage).with({:channel=>channel, :text=>text, :as_user=>true})
78
+ end
69
79
  subject
70
80
  end
71
81
 
72
- context "with all reports pre-filled", vcr: {cassette_name: 'standup_all_reports_prefilled'} do
82
+ context "with all reports pre-filled" do
73
83
  before do
74
84
  send_message("!standup report My standup report for testing purposes", as: sybil, from: channel)
75
85
  send_message("!standup report My standup report for testing purposes", as: zaratan, from: channel)
76
86
  end
77
87
 
78
88
  it "displays the standups and ends the meeting" do
79
- [ "Hello <!channel> ! Le standup va commencer : )",
80
- "zaratan a déjà renseigné son standup : \n My standup report for testing purposes",
81
- "sybil a déjà renseigné son standup : \n My standup report for testing purposes",
82
- "Et voilà ! C'est bon pour aujourd'hui. Merci tout le monde :parrot:"
83
- ].each do |text|
84
- expect_any_instance_of(Slack::Web::Client).to receive(:chat_postMessage).with({:channel=>channel, :text=>text, :as_user=>true})
89
+ [ "Hello <!channel> ! Le standup va commencer : )",
90
+ "zaratan a déjà renseigné son standup : \n My standup report for testing purposes",
91
+ "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 :parrot:"
93
+ ].each do |text|
94
+ expect_any_instance_of(Slack::Web::Client).to receive(:chat_postMessage).with({:channel=>channel, :text=>text, :as_user=>true})
85
95
  end
86
96
  subject
87
97
  end
@@ -89,7 +99,7 @@ describe Lita::Handlers::SlackStandup, lita_handler: true do
89
99
  end
90
100
  end
91
101
 
92
- describe "!standup report command", vcr: {cassette_name: 'standup_report'} do
102
+ describe "!standup report command" do
93
103
  subject do
94
104
  send_message("!standup report My standup report for testing purposes", as: sybil, from: channel)
95
105
  end
@@ -105,14 +115,14 @@ describe Lita::Handlers::SlackStandup, lita_handler: true do
105
115
  send_message("!standup next", as: sybil, from: channel)
106
116
  end
107
117
 
108
- context "when its called oustide of standups", vcr: {cassette_name: 'standup_next_refused'} do
118
+ context "when its called oustide of standups" do
109
119
  it "is not available" do
110
120
  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})
111
121
  subject
112
122
  end
113
123
  end
114
124
 
115
- context "when it's called during standup", vcr: {cassette_name: 'standup_next'} do
125
+ context "when it's called during standup" do
116
126
  before do
117
127
  send_message("!standup start", as: sybil, from: channel)
118
128
  end
@@ -124,7 +134,7 @@ describe Lita::Handlers::SlackStandup, lita_handler: true do
124
134
  end
125
135
  end
126
136
 
127
- describe "!standup ignore user command", vcr: {cassette_name: 'standup_ignore'} do
137
+ describe "!standup ignore user command" do
128
138
 
129
139
  before do
130
140
  send_message("!standup start", as: sybil, from: channel)
@@ -142,7 +152,7 @@ describe Lita::Handlers::SlackStandup, lita_handler: true do
142
152
  end
143
153
  end
144
154
 
145
- describe "!standup unignore user command", vcr: {cassette_name: 'standup_unignore'} do
155
+ describe "!standup unignore user command" do
146
156
 
147
157
  before do
148
158
  send_message("!standup start", as: sybil, from: channel)
data/spec/spec_helper.rb CHANGED
@@ -6,29 +6,17 @@ require "webmock/rspec"
6
6
  # was generated with Lita 4, the compatibility mode should be left disabled.
7
7
  Lita.version_3_compatibility_mode = false
8
8
 
9
-
10
9
  lib = File.expand_path('../lib/')
11
10
  $:.unshift lib unless $:.include?(lib)
12
11
 
13
- require "vcr"
14
12
  require "slack-ruby-client"
15
13
  require "slack_client"
16
14
  require "redis-objects"
17
15
 
18
-
19
16
  # A compatibility mode is provided for older plugins upgrading from Lita 3. Since this plugin
20
17
  # was generated with Lita 4, the compatibility mode should be left disabled.
21
18
  Lita.version_3_compatibility_mode = false
22
19
 
23
-
24
-
25
- VCR.configure do |config|
26
- config.cassette_library_dir = "spec/fixtures/vcr"
27
- config.configure_rspec_metadata!
28
- config.hook_into :webmock
29
- config.filter_sensitive_data("<SLACK_LITA_TOKEN>") { ENV['SLACK_LITA_TOKEN'] }
30
- end
31
-
32
20
  RSpec.configure do |c|
33
21
  c.after do
34
22
  Redis.new.flushdb
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.3.0
4
+ version: 0.5.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-02-27 00:00:00.000000000 Z
11
+ date: 2016-02-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: lita
@@ -80,20 +80,6 @@ dependencies:
80
80
  - - "~>"
81
81
  - !ruby/object:Gem::Version
82
82
  version: '1.3'
83
- - !ruby/object:Gem::Dependency
84
- name: pry-byebug
85
- requirement: !ruby/object:Gem::Requirement
86
- requirements:
87
- - - ">="
88
- - !ruby/object:Gem::Version
89
- version: '0'
90
- type: :development
91
- prerelease: false
92
- version_requirements: !ruby/object:Gem::Requirement
93
- requirements:
94
- - - ">="
95
- - !ruby/object:Gem::Version
96
- version: '0'
97
83
  - !ruby/object:Gem::Dependency
98
84
  name: rake
99
85
  requirement: !ruby/object:Gem::Requirement
@@ -108,20 +94,6 @@ dependencies:
108
94
  - - ">="
109
95
  - !ruby/object:Gem::Version
110
96
  version: '0'
111
- - !ruby/object:Gem::Dependency
112
- name: rack-test
113
- requirement: !ruby/object:Gem::Requirement
114
- requirements:
115
- - - ">="
116
- - !ruby/object:Gem::Version
117
- version: '0'
118
- type: :development
119
- prerelease: false
120
- version_requirements: !ruby/object:Gem::Requirement
121
- requirements:
122
- - - ">="
123
- - !ruby/object:Gem::Version
124
- version: '0'
125
97
  - !ruby/object:Gem::Dependency
126
98
  name: rspec
127
99
  requirement: !ruby/object:Gem::Requirement
@@ -150,20 +122,6 @@ dependencies:
150
122
  - - ">="
151
123
  - !ruby/object:Gem::Version
152
124
  version: '0'
153
- - !ruby/object:Gem::Dependency
154
- name: vcr
155
- requirement: !ruby/object:Gem::Requirement
156
- requirements:
157
- - - ">="
158
- - !ruby/object:Gem::Version
159
- version: '0'
160
- type: :development
161
- prerelease: false
162
- version_requirements: !ruby/object:Gem::Requirement
163
- requirements:
164
- - - ">="
165
- - !ruby/object:Gem::Version
166
- version: '0'
167
125
  description: Standup feature for slack
168
126
  email:
169
127
  - sybil.deboin@gmail.com
@@ -208,7 +166,7 @@ rubyforge_project:
208
166
  rubygems_version: 2.4.6
209
167
  signing_key:
210
168
  specification_version: 4
211
- summary: ''
169
+ summary: A lita gem to enable standups on slack
212
170
  test_files:
213
171
  - spec/lita/handlers/slack_standup_spec.rb
214
172
  - spec/spec_helper.rb