2024-11-07 13:00:11 -05:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
2024-11-04 07:06:04 -05:00
|
|
|
require 'rails_helper'
|
|
|
|
|
|
|
|
|
|
RSpec.describe ImportsChannel, type: :channel do
|
2024-11-07 13:00:11 -05:00
|
|
|
let(:user) { create(:user) }
|
|
|
|
|
|
2024-11-07 13:15:03 -05:00
|
|
|
before do
|
|
|
|
|
stub_connection(current_user: user)
|
2024-11-07 13:00:11 -05:00
|
|
|
end
|
|
|
|
|
|
2024-11-07 13:15:03 -05:00
|
|
|
it 'subscribes to a stream for the current user' do
|
|
|
|
|
subscribe
|
2024-11-07 13:00:11 -05:00
|
|
|
|
2024-11-07 13:15:03 -05:00
|
|
|
expect(subscription).to be_confirmed
|
|
|
|
|
expect(subscription).to have_stream_for(user)
|
2024-11-07 13:00:11 -05:00
|
|
|
end
|
2024-11-04 07:06:04 -05:00
|
|
|
end
|