Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions lib/turbo/system_test_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ def assert_no_turbo_cable_stream_source(...)
end

Capybara.add_selector :turbo_cable_stream_source do
visible :all

xpath do |locator|
xpath = XPath.descendant.where(XPath.local_name == "turbo-cable-stream-source")
xpath.where(SignedStreamNameConditions.new(locator).reduce(:|))
Expand Down
2 changes: 1 addition & 1 deletion test/dummy/app/views/messages/show.html.erb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<h1>Message #<%= @message.id %></h1>

<%= turbo_stream_from @message %>
<%= turbo_stream_from @message, style: "display: none" %>

<div id="<%= dom_id @message %>">
<%= render @message %>
Expand Down
2 changes: 1 addition & 1 deletion test/system/broadcasts_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ class BroadcastsTest < ApplicationSystemTestCase
private

def reconnect_cable_stream_source(from:, to:)
cable_stream_source = find("turbo-cable-stream-source[signed-stream-name=#{signed_stream_name(from)}]")
cable_stream_source = find(:turbo_cable_stream_source, signed_stream_name: from)

cable_stream_source.execute_script <<~JS, signed_stream_name(to)
this.setAttribute("signed-stream-name", arguments[0])
Expand Down