aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/controller/streaming_test.rb
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack/test/controller/streaming_test.rb')
-rw-r--r--actionpack/test/controller/streaming_test.rb28
1 files changed, 28 insertions, 0 deletions
diff --git a/actionpack/test/controller/streaming_test.rb b/actionpack/test/controller/streaming_test.rb
new file mode 100644
index 0000000000..5a42e2ae6d
--- /dev/null
+++ b/actionpack/test/controller/streaming_test.rb
@@ -0,0 +1,28 @@
+# frozen_string_literal: true
+
+require "abstract_unit"
+
+module ActionController
+ class StreamingResponseTest < ActionController::TestCase
+ class TestController < ActionController::Base
+ def self.controller_path
+ "test"
+ end
+
+ def basic_stream
+ %w{ hello world }.each do |word|
+ response.stream.write word
+ response.stream.write "\n"
+ end
+ response.stream.close
+ end
+ end
+
+ tests TestController
+
+ def test_write_to_stream
+ get :basic_stream
+ assert_equal "hello\nworld\n", @response.body
+ end
+ end
+end