2019-10-24 20:07:01 +00:00
|
|
|
require 'rails_helper'
|
|
|
|
|
|
|
|
RSpec.describe RoomChannel, type: :channel do
|
2021-11-22 18:02:17 +00:00
|
|
|
let!(:contact_inbox) { create(:contact_inbox) }
|
2019-10-24 20:07:01 +00:00
|
|
|
|
|
|
|
before do
|
|
|
|
stub_connection
|
|
|
|
end
|
|
|
|
|
|
|
|
it 'subscribes to a stream when pubsub_token is provided' do
|
2021-11-22 18:02:17 +00:00
|
|
|
subscribe(pubsub_token: contact_inbox.pubsub_token)
|
2019-10-24 20:07:01 +00:00
|
|
|
expect(subscription).to be_confirmed
|
2021-11-22 18:02:17 +00:00
|
|
|
expect(subscription).to have_stream_for(contact_inbox.pubsub_token)
|
2019-10-24 20:07:01 +00:00
|
|
|
end
|
|
|
|
end
|