Replace pusher with action cable (#178)

closes #43
This commit is contained in:
Pranav Raj S
2019-10-25 01:37:01 +05:30
committed by Sojan Jose
parent c0354364ff
commit f4358d9993
28 changed files with 144 additions and 165 deletions

View File

@@ -0,0 +1,15 @@
require 'rails_helper'
RSpec.describe RoomChannel, type: :channel do
let!(:user) { create(:user) }
before do
stub_connection
end
it 'subscribes to a stream when pubsub_token is provided' do
subscribe(pubsub_token: user.uid)
expect(subscription).to be_confirmed
expect(subscription).to have_stream_for(user.uid)
end
end

View File

@@ -4,6 +4,8 @@ require File.expand_path('../config/environment', __dir__)
# Prevent database truncation if the environment is production
abort('The Rails environment is running in production mode!') if Rails.env.production?
require 'rspec/rails'
require 'action_cable/testing/rspec'
# Add additional requires below this line. Rails is not loaded until this point!
# Requires supporting ruby files with custom matchers and macros, etc, in