class LiveStreamRouterTest::TestController

Public Instance Methods

index() click to toggle source
# File actionpack/test/controller/live_stream_test.rb, line 485
def index
  response.headers["Content-Type"] = "text/event-stream"
  sse = SSE.new(response.stream)
  sse.write("{\"name\":\"John\"}")
  sse.write(name: "Ryan")
ensure
  sse.close
end