Skip to content

Commit 557d038

Browse files
committed
Remove configure_global_aliases.
1 parent 0b56772 commit 557d038

File tree

2 files changed

+9
-27
lines changed

2 files changed

+9
-27
lines changed

lib/slack-ruby-bot-server/app.rb

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
module SlackRubyBotServer
22
class App
3+
include SlackRubyBotServer::Loggable
4+
35
def prepare!
46
check_database!
57
init_database!
68
purge_inactive_teams!
7-
configure_global_aliases!
89
end
910

1011
def self.instance
@@ -13,13 +14,6 @@ def self.instance
1314

1415
private
1516

16-
def logger
17-
@logger ||= begin
18-
STDOUT.sync = true
19-
Logger.new(STDOUT)
20-
end
21-
end
22-
2317
def check_database!
2418
SlackRubyBotServer::DatabaseAdapter.check!
2519
end
@@ -31,11 +25,5 @@ def init_database!
3125
def purge_inactive_teams!
3226
Team.purge!
3327
end
34-
35-
def configure_global_aliases!
36-
SlackRubyBot.configure do |config|
37-
config.aliases = ENV['SLACK_RUBY_BOT_ALIASES'].split(' ') if ENV['SLACK_RUBY_BOT_ALIASES']
38-
end
39-
end
4028
end
4129
end

spec/integration/teams_spec.rb

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -23,23 +23,21 @@
2323
end
2424
it 'registers a team' do
2525
expect do
26-
visit '/?code=code'
26+
visit '/?v1&code=code'
2727
expect(page.find('#messages')).to have_content 'Team successfully registered!'
2828
end.to change(Team, :count).by(1)
2929
end
3030
it 'includes optional parameter' do
3131
expect(SlackRubyBotServer::Service.instance).to receive(:create!).with(instance_of(Team), state: 'property')
32-
visit '/?code=code&state=property'
32+
visit '/?v1&code=code&state=property'
3333
end
3434
end
3535
context 'homepage' do
3636
before do
3737
visit '/?v1'
3838
end
39-
it 'displays index.html page' do
40-
expect(title).to eq('Slack Ruby Bot Server')
41-
end
4239
it 'includes a link to add to slack with the client id' do
40+
expect(title).to eq('Slack Ruby Bot Server')
4341
expect(find("a[href='https://slack.com/oauth/authorize?scope=channels:read+channels:write&client_id=client_id"))
4442
end
4543
end
@@ -55,26 +53,22 @@
5553
end
5654
it 'registers a team' do
5755
expect do
58-
visit '/?code=code'
56+
visit '/?v2&code=code'
5957
expect(page.find('#messages')).to have_content 'Team successfully registered!'
6058
end.to change(Team, :count).by(1)
6159
end
6260
it 'includes optional parameter' do
6361
expect(SlackRubyBotServer::Service.instance).to receive(:create!).with(instance_of(Team), state: 'property')
64-
visit '/?code=code&state=property'
62+
visit '/?v2&code=code&state=property'
6563
end
6664
end
6765
context 'homepage' do
6866
before do
6967
visit '/?v2'
7068
end
71-
it 'displays index.html page' do
69+
it 'includes a link to add to slack with the client id' do
7270
expect(title).to eq('Slack Ruby Bot Server')
73-
end
74-
context 'oauth' do
75-
it 'includes a link to add to slack with the client id' do
76-
expect(find("a[href='https://slack.com/oauth/v2/authorize?scope=channels:read+channels:write&client_id=client_id"))
77-
end
71+
expect(find("a[href='https://slack.com/oauth/v2/authorize?scope=channels:read+channels:write&client_id=client_id"))
7872
end
7973
end
8074
end

0 commit comments

Comments
 (0)