I am currently experimenting with ActionController :: Live, and I cannot figure out how to verify this correctly.
In my controller I have written
response.stream.write("event: #{event}\n") response.stream.write("data: #{post.to_json}\n\n")
But when I check the object in my rspec test, I see this
(rdb:1) response.stream.instance_variable_get(:@buf) ["event: event\n"]
When I write βdataβ to a stream, I cannot understand why for some reason it does not appear in the array. When I delete the first line of response.stream.write, buf returns an empty array.
source share