Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
dorianmariecom opened this issue Jan 17, 2022 · 2 comments · Fixed by #1692
Assignees
Projects
Milestone

Comments

@dorianmariecom
Copy link

dorianmariecom commented Jan 17, 2022

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

@st0012
Copy link
Collaborator

st0012 commented Jan 17, 2022

@dorianmariefr Thanks for reporting this. I've added #1692 for it.

@dorianmariecom
Copy link
Author

thanks

4.x automation moved this from To do to Done Jan 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
4.x
  
Done
Development

Successfully merging a pull request may close this issue.

2 participants