Skip to content

Commit d0d6a0f

Browse files
committed
Only ping active teams for status.
1 parent fe1e119 commit d0d6a0f

File tree

4 files changed

+27
-28
lines changed

4 files changed

+27
-28
lines changed

CHANGELOG.md

Lines changed: 11 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,13 @@
11
### Changelog
22

3-
### 2/11/2016
4-
5-
* Implemented an OOB GC - [@dblock](https://github.com/dblock).
6-
* Swapped Puma for Unicorn - [@dblock](https://github.com/dblock).
7-
* Fix: wait for the EventMachine reactor to start - [@dblock](https://github.com/dblock).
8-
9-
### 1/21/2016
10-
11-
* Rebranded as Slack API Explorer - [@dblock](https://github.com/dblock).
12-
13-
### 1/15/2016
14-
15-
* Fix: respond to @bot - [@dblock](https://github.com/dblock).
16-
17-
### 1/6/2016
18-
19-
* [#1](https://github.com/slack-ruby/slack-api-explorer/issues/1): Added JSON processing - [@dblock](https://github.com/dblock).
20-
* JSON output is now prettier - [@dblock](https://github.com/dblock).
21-
22-
### 1/5/2016
23-
24-
* Initial public release - [@dblock](https://github.com/dblock).
3+
* 2023/01/16: Replaced Travis-CI with GHA - [@dblock](https://github.com/dblock).
4+
* 2018/05/10: Use ERB instead of static pages - [@dblock](https://github.com/dblock).
5+
* 2017/03/14: Use slack-ruby-bot-server - [@dblock](https://github.com/dblock).
6+
* 2016/02/11: Implemented an OOB GC - [@dblock](https://github.com/dblock).
7+
* 2016/02/11: Swapped Puma for Unicorn - [@dblock](https://github.com/dblock).
8+
* 2016/02/11: Fix: wait for the EventMachine reactor to start - [@dblock](https://github.com/dblock).
9+
* 2016/01/21: Rebranded as Slack API Explorer - [@dblock](https://github.com/dblock).
10+
* 2016/01/15: Fix: respond to @bot - [@dblock](https://github.com/dblock).
11+
* 2016/01/06: [#1](https://github.com/slack-ruby/slack-api-explorer/issues/1): Added JSON processing - [@dblock](https://github.com/dblock).
12+
* 2016/01/06:JSON output is now prettier - [@dblock](https://github.com/dblock).
13+
* 2016/01/05: Initial public release - [@dblock](https://github.com/dblock).

Gemfile.lock

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -119,9 +119,9 @@ GEM
119119
addressable (~> 2.3)
120120
mailchimp_api_v3 (0.2.18)
121121
rest-client (~> 2)
122-
mime-types (3.2.2)
122+
mime-types (3.4.1)
123123
mime-types-data (~> 3.2015)
124-
mime-types-data (3.2019.0331)
124+
mime-types-data (3.2022.0105)
125125
mini_mime (1.0.1)
126126
mini_portile2 (2.8.1)
127127
minitest (5.11.3)
@@ -243,7 +243,7 @@ GEM
243243
thread_safe (0.3.6)
244244
timers (4.3.0)
245245
to_regexp (0.2.1)
246-
tzinfo (1.2.5)
246+
tzinfo (1.2.10)
247247
thread_safe (~> 0.1)
248248
uber (0.1.0)
249249
unf (0.1.4)

slack-api-explorer/api/presenters/status_presenter.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ module StatusPresenter
1414
property :ping
1515

1616
def ping
17-
team = Team.asc(:_id).where(api: true).first
17+
team = Team.active.asc(:_id).where(api: true).first
1818
return unless team
1919

2020
team.ping!

spec/api/endpoints/status_endpoint_spec.rb

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,24 @@
1313
expect(status.teams_count).to eq 0
1414
end
1515

16-
context 'with a team' do
17-
let!(:team) { Fabricate(:team, active: false) }
16+
context 'with an active team' do
17+
let!(:team) { Fabricate(:team, active: true) }
1818
it 'returns a status with ping' do
1919
status = client.status
2020
expect(status.teams_count).to eq 1
21+
expect(status.active_teams_count).to eq 1
2122
ping = status.ping
2223
expect(ping['ok']).to eq 1
2324
end
2425
end
26+
27+
context 'with an inactive team' do
28+
let!(:team) { Fabricate(:team, active: false) }
29+
it 'returns no status' do
30+
status = client.status
31+
expect(status.active_teams_count).to eq 0
32+
expect(status.teams_count).to eq 1
33+
end
34+
end
2535
end
2636
end

0 commit comments

Comments
 (0)