Skip to content

Doesn't execute blocks of capture() in tests: doesn't call subscribed from an action cable channel #1691

@dorianmariecom

Description

@dorianmariecom

Issue Description

I'm trying to reproduce a bug with my action cable channel in my tests (rspec 3) (rails 7) and couldn't get the subscribed method to execute

Reproduction Steps

have a channel:

class MessagesChannel < ApplicationCable::Channel
  def subscribed
    raise NotImplementedError
  end
end

Test it:

require "rails_helper"

RSpec.describe MessagesChannel do
  before do
    stub_connection
  end

  it "rejects subscriptions without a current user" do
    expect { subscribe }.to raise_error(NotImplementedError)
  end
end

Expected Behavior

executes the subscribed block

Actual Behavior

doesn't execute the subscribed block

Ruby Version

ruby 3.1.0p0 (2021-12-25 revision fb4df44d16) [x86_64-darwin21]

SDK Version

sentry-ruby-core (4.9.1)

Integration and Its Version

sentry-rails (4.9.1)

Sentry Config

No response

Metadata

Metadata

Assignees

No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions