Skip to content

Commit

Permalink
Fix: stub revoking token.
Browse files Browse the repository at this point in the history
  • Loading branch information
dblock committed Oct 6, 2024
1 parent 9a3feed commit 9d9fc5f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions spec/slack-strava/commands/disconnect_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
it 'disconnects a user' do
expect(User).to receive(:find_create_or_update_by_slack_id!).and_return(user)
expect(user).to receive(:dm!).with(text: 'Your Strava account has been successfully disconnected.')
expect(user).to receive(:refresh_access_token!)
expect(user.strava_client).to receive(:deauthorize).and_return(Hashie::Mash.new(access_token: 'token'))
message_hook.call(client, Hashie::Mash.new(channel: 'channel', user: SlackRubyBot.config.user, text: "#{SlackRubyBot.config.user} disconnect"))
user.reload
expect(user.access_token).to be_nil
Expand Down

0 comments on commit 9d9fc5f

Please sign in to comment.