Sha256: 5b8e75f65b1c7985fdb0f1dcce3dd0d72a710ccf8a04d355d2c3f810cc13c10d
Contents?: true
Size: 1.25 KB
Versions: 1
Compression:
Stored size: 1.25 KB
Contents
# frozen_string_literal: true require 'spec_helper' RSpec.describe Slack::RealTime::Client, vcr: { cassette_name: 'web/rtm_start' } do include_context 'connected client' context 'im' do it 'sets im data' do expect(client.ims.count).to eq 10 end it 'im_created' do expect(client.ims['CDEADBEEF']).to be_nil event = Slack::RealTime::Event.new( 'type' => 'im_created', 'channel' => { 'id' => 'CDEADBEEF', 'name' => 'beef' } ) client.send(:dispatch, event) im = client.ims['CDEADBEEF'] expect(im).not_to be_nil expect(im.name).to eq 'beef' end it 'im_open' do im = client.ims['D0J1H6QTV'] expect(im).not_to be_nil im.is_open = false event = Slack::RealTime::Event.new( 'type' => 'im_open', 'channel' => 'D0J1H6QTV' ) client.send(:dispatch, event) expect(im.is_open).to be true end it 'im_close' do im = client.ims['D0J1H6QTV'] expect(im).not_to be_nil expect(im.is_open).to be true event = Slack::RealTime::Event.new( 'type' => 'im_close', 'channel' => 'D0J1H6QTV' ) client.send(:dispatch, event) expect(im.is_open).to be false end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
slack-ruby-client-1.1.0 | spec/slack/real_time/event_handlers/im_spec.rb |