Skip to content
This repository has been archived by the owner on Jun 30, 2022. It is now read-only.

Commit

Permalink
Pass IMMapping an API, not a token. Fixes #17.
Browse files Browse the repository at this point in the history
  • Loading branch information
jimmycuadra committed Jan 26, 2015
1 parent 8a8f6a0 commit e2264d6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/lita/adapters/slack/rtm_connection.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def build(robot, token)

def initialize(robot, token, team_data)
@robot = robot
@im_mapping = IMMapping.new(token, team_data.ims)
@im_mapping = IMMapping.new(API.new(token), team_data.ims)
@websocket_url = team_data.websocket_url
@robot_id = team_data.self.id

Expand Down
5 changes: 4 additions & 1 deletion spec/lita/adapters/slack/rtm_connection_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,10 @@ def with_websocket(subject, queue)

describe "#im_for" do
before do
allow(Lita::Adapters::Slack::IMMapping).to receive(:new).and_return(im_mapping)
allow(Lita::Adapters::Slack::API).to receive(:new).with(token).and_return(api)
allow(
Lita::Adapters::Slack::IMMapping
).to receive(:new).with(api, []).and_return(im_mapping)
allow(im_mapping).to receive(:im_for).with('U12345678').and_return('D024BFF1M')
end

Expand Down

0 comments on commit e2264d6

Please sign in to comment.