Sha256: a590f19ae71586ba0245c2415d7a63cf5cae98bc8619e9ef0e96c80f2f1abf06

Contents?: true

Size: 891 Bytes

Versions: 3

Compression:

Stored size: 891 Bytes

Contents

require_relative "broadcaster_test_case"

class StimulusReflex::NothingBroadcasterTest < StimulusReflex::BroadcasterTestCase
  test "broadcasts a server message when called" do
    broadcaster = StimulusReflex::NothingBroadcaster.new(@reflex)

    expected = {
      "cableReady" => true,
      "operations" => {
        "dispatchEvent" => [
          {
            "name" => "stimulus-reflex:server-message",
            "detail" => {
              "reflexId" => nil,
              "stimulusReflex" => {
                "some" => :data,
                "morph" => :nothing,
                "serverMessage" => {
                  "subject" => "nothing",
                  "body" => nil
                }
              }
            }
          }
        ]
      }
    }

    assert_broadcast_on @reflex.stream_name, expected do
      broadcaster.broadcast nil, some: :data
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
stimulus_reflex-3.4.0.pre8 test/broadcasters/nothing_broadcaster_test.rb
stimulus_reflex-3.4.0.pre7 test/broadcasters/nothing_broadcaster_test.rb
stimulus_reflex-3.4.0.pre6 test/broadcasters/nothing_broadcaster_test.rb