From eee3619e194f71fe2b71b2449e4b2e98d21d315a Mon Sep 17 00:00:00 2001 From: Marco Roth Date: Sun, 26 Jul 2020 11:29:38 +0200 Subject: [PATCH] update collection broadcast test to include locals --- test/cable/channel_test.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/cable/channel_test.rb b/test/cable/channel_test.rb index 86c7d44..8f4cdf6 100644 --- a/test/cable/channel_test.rb +++ b/test/cable/channel_test.rb @@ -74,7 +74,7 @@ class Futurism::ChannelTest < ActionCable::Channel::TestCase renderer_spy = Spy.on(ApplicationController, :render) Post.create title: "Lorem" Post.create title: "Ipsum" - fragment = Nokogiri::HTML.fragment(futurize(partial: "posts/card", collection: Post.all, extends: :div) {}) + fragment = Nokogiri::HTML.fragment(futurize(partial: "posts/card", collection: Post.all, extends: :div, locals: {important_local: "needed to render"}) {}) signed_params = fragment.children.first["data-signed-params"] subscribe @@ -83,7 +83,7 @@ class Futurism::ChannelTest < ActionCable::Channel::TestCase signed_params = fragment.children.last["data-signed-params"] perform :receive, {"signed_params" => [signed_params]} - assert renderer_spy.has_been_called_with?(partial: "posts/card", locals: {post: Post.first}) - assert renderer_spy.has_been_called_with?(partial: "posts/card", locals: {post: Post.last}) + assert renderer_spy.has_been_called_with?(partial: "posts/card", locals: {post: Post.first, important_local: "needed to render"}) + assert renderer_spy.has_been_called_with?(partial: "posts/card", locals: {post: Post.last, important_local: "needed to render"}) end end