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

uninitialized constant Turbo::Broadcastable::TestHelper::ActionCable #573

Closed
jcoyne opened this issue Feb 9, 2024 · 3 comments · Fixed by #574
Closed

uninitialized constant Turbo::Broadcastable::TestHelper::ActionCable #573

jcoyne opened this issue Feb 9, 2024 · 3 comments · Fixed by #574

Comments

@jcoyne
Copy link
Contributor

jcoyne commented Feb 9, 2024

When generating a Rails app with --skip-action-cable and then installing turbo rails 2.0.2 I see this error when I load the test environment:

NameError:
  uninitialized constant Turbo::Broadcastable::TestHelper::ActionCable

This was not a problem with turbo-rails 1.5.0 or 2.0.0

@jcoyne
Copy link
Contributor Author

jcoyne commented Feb 9, 2024

@swanson could this have been introduced by #565 ? via https://github.com/hotwired/turbo-rails/blob/main/lib/turbo/broadcastable/test_helper.rb#L7

@taylorthurlow
Copy link

Looks like you beat me to this one by 10 minutes. Yeah it's definitely the test helper assuming that ActionCable is available. I believe the entire test helper should be able to be skipped if ActionCable isn't present, the helper isn't useful otherwise.

seanpdoyle added a commit to seanpdoyle/turbo-rails that referenced this issue Feb 9, 2024
Closes [hotwired#573][]
Related to [hotwired#565][]

Re-structure the automatic inclusion of the
`Turbo::Broadcastable::TestHelper` module so that it's only
automatically loaded and installed when Action Cable is available to the
runtime.

[hotwired#573]: hotwired#573
[hotwired#565]: hotwired#565 (comment)
@seanpdoyle
Copy link
Contributor

seanpdoyle commented Feb 9, 2024

I've opened #574 to try to address this.

I'm a little hazy on the loading order quirks, so could you pull it down and test it out with your application's test harnesses?

jcoyne added a commit to projectblacklight/blacklight that referenced this issue Feb 9, 2024
This works around a bug in turbo-rails 2.0.2 hotwired/turbo-rails#573
We should be able to revert this if that issue is resolved in a future release
seanpdoyle added a commit to seanpdoyle/turbo-rails that referenced this issue Feb 9, 2024
Closes [hotwired#573][]
Related to [hotwired#565][]

Re-structure the automatic inclusion of the
`Turbo::Broadcastable::TestHelper` module so that it's only
automatically loaded and installed when Action Cable is available to the
runtime.

[hotwired#573]: hotwired#573
[hotwired#565]: hotwired#565 (comment)
seanpdoyle added a commit to seanpdoyle/turbo-rails that referenced this issue Feb 9, 2024
Closes [hotwired#573][]
Related to [hotwired#565][]

Re-structure the automatic inclusion of the
`Turbo::Broadcastable::TestHelper` module so that it's only
automatically loaded and installed when Action Cable is available to the
runtime.

[hotwired#573]: hotwired#573
[hotwired#565]: hotwired#565 (comment)
afcapel pushed a commit that referenced this issue Feb 9, 2024
Closes [#573][]
Related to [#565][]

Re-structure the automatic inclusion of the
`Turbo::Broadcastable::TestHelper` module so that it's only
automatically loaded and installed when Action Cable is available to the
runtime.

[#573]: #573
[#565]: #565 (comment)
jcoyne added a commit to projectblacklight/blacklight that referenced this issue Feb 15, 2024
This works around a bug in turbo-rails 2.0.2 hotwired/turbo-rails#573
We should be able to revert this if that issue is resolved in a future release
jcoyne added a commit to projectblacklight/blacklight that referenced this issue Feb 15, 2024
This works around a bug in turbo-rails 2.0.2 hotwired/turbo-rails#573
We should be able to revert this if that issue is resolved in a future release
luisjose1996 added a commit to luisjose1996/Turbo-Rails that referenced this issue May 10, 2024
Closes [#573][]
Related to [#565][]

Re-structure the automatic inclusion of the
`Turbo::Broadcastable::TestHelper` module so that it's only
automatically loaded and installed when Action Cable is available to the
runtime.

[#573]: hotwired/turbo-rails#573
[#565]: hotwired/turbo-rails#565 (comment)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

3 participants