aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/controller
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack/test/controller')
-rw-r--r--actionpack/test/controller/action_pack_assertions_test.rb6
-rw-r--r--actionpack/test/controller/filters_test.rb2
-rw-r--r--actionpack/test/controller/helper_test.rb2
-rw-r--r--actionpack/test/controller/live_stream_test.rb28
4 files changed, 19 insertions, 19 deletions
diff --git a/actionpack/test/controller/action_pack_assertions_test.rb b/actionpack/test/controller/action_pack_assertions_test.rb
index 5b85e83045..ba8a02916b 100644
--- a/actionpack/test/controller/action_pack_assertions_test.rb
+++ b/actionpack/test/controller/action_pack_assertions_test.rb
@@ -318,7 +318,7 @@ class ActionPackAssertionsControllerTest < ActionController::TestCase
def test_missing_response_code
process :response404
- assert @response.missing?
+ assert @response.not_found?
end
def test_client_error_response_code
@@ -346,12 +346,12 @@ class ActionPackAssertionsControllerTest < ActionController::TestCase
def test_successful_response_code
process :nothing
- assert @response.success?
+ assert @response.successful?
end
def test_response_object
process :nothing
- assert_kind_of ActionController::TestResponse, @response
+ assert_kind_of ActionDispatch::TestResponse, @response
end
def test_render_based_on_parameters
diff --git a/actionpack/test/controller/filters_test.rb b/actionpack/test/controller/filters_test.rb
index 8a6a51c263..958097b56d 100644
--- a/actionpack/test/controller/filters_test.rb
+++ b/actionpack/test/controller/filters_test.rb
@@ -819,7 +819,7 @@ class FilterTest < ActionController::TestCase
response = test_process(RescuedController)
end
- assert response.success?
+ assert response.successful?
assert_equal("I rescued this: #<FilterTest::ErrorToRescue: Something made the bad noise.>", response.body)
end
diff --git a/actionpack/test/controller/helper_test.rb b/actionpack/test/controller/helper_test.rb
index a96cfa3bf4..3ecfedefd1 100644
--- a/actionpack/test/controller/helper_test.rb
+++ b/actionpack/test/controller/helper_test.rb
@@ -151,7 +151,7 @@ class HelperTest < ActiveSupport::TestCase
assert_equal "test: baz", call_controller(Fun::PdfController, "test").last.body
#
# request = ActionController::TestRequest.new
- # response = ActionController::TestResponse.new
+ # response = ActionDispatch::TestResponse.new
# request.action = 'test'
#
# assert_equal 'test: baz', Fun::PdfController.process(request, response).body
diff --git a/actionpack/test/controller/live_stream_test.rb b/actionpack/test/controller/live_stream_test.rb
index 0c65270ec1..6161e3f47a 100644
--- a/actionpack/test/controller/live_stream_test.rb
+++ b/actionpack/test/controller/live_stream_test.rb
@@ -1,5 +1,5 @@
require 'abstract_unit'
-require 'active_support/concurrency/latch'
+require 'concurrent/atomics'
Thread.abort_on_exception = true
module ActionController
@@ -145,7 +145,7 @@ module ActionController
response.headers['Content-Type'] = 'text/event-stream'
%w{ hello world }.each do |word|
response.stream.write word
- latch.await
+ latch.wait
end
response.stream.close
end
@@ -212,7 +212,7 @@ module ActionController
# .. plus one more, because the #each frees up a slot:
response.stream.write '.'
- latch.release
+ latch.count_down
# This write will block, and eventually raise
response.stream.write 'x'
@@ -233,7 +233,7 @@ module ActionController
end
logger.info 'Work complete'
- latch.release
+ latch.count_down
end
end
@@ -278,7 +278,7 @@ module ActionController
def test_async_stream
rubinius_skip "https://github.com/rubinius/rubinius/issues/2934"
- @controller.latch = ActiveSupport::Concurrency::Latch.new
+ @controller.latch = Concurrent::CountDownLatch.new
parts = ['hello', 'world']
@controller.request = @request
@@ -289,8 +289,8 @@ module ActionController
resp.stream.each do |part|
assert_equal parts.shift, part
ol = @controller.latch
- @controller.latch = ActiveSupport::Concurrency::Latch.new
- ol.release
+ @controller.latch = Concurrent::CountDownLatch.new
+ ol.count_down
end
}
@@ -300,23 +300,23 @@ module ActionController
end
def test_abort_with_full_buffer
- @controller.latch = ActiveSupport::Concurrency::Latch.new
+ @controller.latch = Concurrent::CountDownLatch.new
@request.parameters[:format] = 'plain'
@controller.request = @request
@controller.response = @response
- got_error = ActiveSupport::Concurrency::Latch.new
+ got_error = Concurrent::CountDownLatch.new
@response.stream.on_error do
ActionController::Base.logger.warn 'Error while streaming'
- got_error.release
+ got_error.count_down
end
t = Thread.new(@response) { |resp|
resp.await_commit
_, _, body = resp.to_a
body.each do |part|
- @controller.latch.await
+ @controller.latch.wait
body.close
break
end
@@ -325,13 +325,13 @@ module ActionController
capture_log_output do |output|
@controller.process :overfill_buffer_and_die
t.join
- got_error.await
+ got_error.wait
assert_match 'Error while streaming', output.rewind && output.read
end
end
def test_ignore_client_disconnect
- @controller.latch = ActiveSupport::Concurrency::Latch.new
+ @controller.latch = Concurrent::CountDownLatch.new
@controller.request = @request
@controller.response = @response
@@ -349,7 +349,7 @@ module ActionController
@controller.process :ignore_client_disconnect
t.join
Timeout.timeout(3) do
- @controller.latch.await
+ @controller.latch.wait
end
assert_match 'Work complete', output.rewind && output.read
end