2019-10-24 20:07:01 +00:00
|
|
|
require 'rails_helper'
|
|
|
|
|
|
|
|
RSpec.describe RoomChannel, type: :channel do
|
2020-07-04 06:12:47 +00:00
|
|
|
let!(:contact) { create(:contact) }
|
2019-10-24 20:07:01 +00:00
|
|
|
|
|
|
|
before do
|
|
|
|
stub_connection
|
|
|
|
end
|
|
|
|
|
|
|
|
it 'subscribes to a stream when pubsub_token is provided' do
|
2020-07-04 06:12:47 +00:00
|
|
|
subscribe(pubsub_token: contact.pubsub_token)
|
2019-10-24 20:07:01 +00:00
|
|
|
expect(subscription).to be_confirmed
|
2020-07-04 06:12:47 +00:00
|
|
|
expect(subscription).to have_stream_for(contact.pubsub_token)
|
2019-10-24 20:07:01 +00:00
|
|
|
end
|
|
|
|
end
|