diff --git a/CHANGELOG.md b/CHANGELOG.md index edf5425..eba3099 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,24 +1,13 @@ ### Changelog -### 2/11/2016 - -* Implemented an OOB GC - [@dblock](https://github.com/dblock). -* Swapped Puma for Unicorn - [@dblock](https://github.com/dblock). -* Fix: wait for the EventMachine reactor to start - [@dblock](https://github.com/dblock). - -### 1/21/2016 - -* Rebranded as Slack API Explorer - [@dblock](https://github.com/dblock). - -### 1/15/2016 - -* Fix: respond to @bot - [@dblock](https://github.com/dblock). - -### 1/6/2016 - -* [#1](https://github.com/slack-ruby/slack-api-explorer/issues/1): Added JSON processing - [@dblock](https://github.com/dblock). -* JSON output is now prettier - [@dblock](https://github.com/dblock). - -### 1/5/2016 - -* Initial public release - [@dblock](https://github.com/dblock). +* 2023/01/16: Replaced Travis-CI with GHA - [@dblock](https://github.com/dblock). +* 2018/05/10: Use ERB instead of static pages - [@dblock](https://github.com/dblock). +* 2017/03/14: Use slack-ruby-bot-server - [@dblock](https://github.com/dblock). +* 2016/02/11: Implemented an OOB GC - [@dblock](https://github.com/dblock). +* 2016/02/11: Swapped Puma for Unicorn - [@dblock](https://github.com/dblock). +* 2016/02/11: Fix: wait for the EventMachine reactor to start - [@dblock](https://github.com/dblock). +* 2016/01/21: Rebranded as Slack API Explorer - [@dblock](https://github.com/dblock). +* 2016/01/15: Fix: respond to @bot - [@dblock](https://github.com/dblock). +* 2016/01/06: [#1](https://github.com/slack-ruby/slack-api-explorer/issues/1): Added JSON processing - [@dblock](https://github.com/dblock). +* 2016/01/06:JSON output is now prettier - [@dblock](https://github.com/dblock). +* 2016/01/05: Initial public release - [@dblock](https://github.com/dblock). diff --git a/Gemfile.lock b/Gemfile.lock index 0bac2a5..a0f6224 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -119,9 +119,9 @@ GEM addressable (~> 2.3) mailchimp_api_v3 (0.2.18) rest-client (~> 2) - mime-types (3.2.2) + mime-types (3.4.1) mime-types-data (~> 3.2015) - mime-types-data (3.2019.0331) + mime-types-data (3.2022.0105) mini_mime (1.0.1) mini_portile2 (2.8.1) minitest (5.11.3) @@ -243,7 +243,7 @@ GEM thread_safe (0.3.6) timers (4.3.0) to_regexp (0.2.1) - tzinfo (1.2.5) + tzinfo (1.2.10) thread_safe (~> 0.1) uber (0.1.0) unf (0.1.4) diff --git a/slack-api-explorer/api/presenters/status_presenter.rb b/slack-api-explorer/api/presenters/status_presenter.rb index d47be94..efb733b 100644 --- a/slack-api-explorer/api/presenters/status_presenter.rb +++ b/slack-api-explorer/api/presenters/status_presenter.rb @@ -14,7 +14,7 @@ module StatusPresenter property :ping def ping - team = Team.asc(:_id).where(api: true).first + team = Team.active.asc(:_id).where(api: true).first return unless team team.ping! diff --git a/spec/api/endpoints/status_endpoint_spec.rb b/spec/api/endpoints/status_endpoint_spec.rb index aa08919..3da7b3f 100644 --- a/spec/api/endpoints/status_endpoint_spec.rb +++ b/spec/api/endpoints/status_endpoint_spec.rb @@ -13,14 +13,24 @@ expect(status.teams_count).to eq 0 end - context 'with a team' do - let!(:team) { Fabricate(:team, active: false) } + context 'with an active team' do + let!(:team) { Fabricate(:team, active: true) } it 'returns a status with ping' do status = client.status expect(status.teams_count).to eq 1 + expect(status.active_teams_count).to eq 1 ping = status.ping expect(ping['ok']).to eq 1 end end + + context 'with an inactive team' do + let!(:team) { Fabricate(:team, active: false) } + it 'returns no status' do + status = client.status + expect(status.active_teams_count).to eq 0 + expect(status.teams_count).to eq 1 + end + end end end