aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/controller
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack/test/controller')
-rw-r--r--actionpack/test/controller/filters_test.rb10
-rw-r--r--actionpack/test/controller/log_subscriber_test.rb20
-rw-r--r--actionpack/test/controller/new_base/bare_metal_test.rb2
-rw-r--r--actionpack/test/controller/request/test_request_test.rb3
-rw-r--r--actionpack/test/controller/routing_test.rb4
5 files changed, 19 insertions, 20 deletions
diff --git a/actionpack/test/controller/filters_test.rb b/actionpack/test/controller/filters_test.rb
index 68febf425d..330fa276d0 100644
--- a/actionpack/test/controller/filters_test.rb
+++ b/actionpack/test/controller/filters_test.rb
@@ -664,7 +664,7 @@ class FilterTest < ActionController::TestCase
end
def test_prepending_and_appending_around_filter
- controller = test_process(MixedFilterController)
+ test_process(MixedFilterController)
assert_equal " before aroundfilter before procfilter before appended aroundfilter " +
" after appended aroundfilter after procfilter after aroundfilter ",
MixedFilterController.execution_log
@@ -677,26 +677,26 @@ class FilterTest < ActionController::TestCase
end
def test_before_filter_rendering_breaks_filtering_chain_for_after_filter
- response = test_process(RenderingController)
+ test_process(RenderingController)
assert_equal %w( before_filter_rendering ), assigns["ran_filter"]
assert !assigns["ran_action"]
end
def test_before_filter_redirects_breaks_filtering_chain_for_after_filter
- response = test_process(BeforeFilterRedirectionController)
+ test_process(BeforeFilterRedirectionController)
assert_response :redirect
assert_equal "http://test.host/filter_test/before_filter_redirection/target_of_redirection", redirect_to_url
assert_equal %w( before_filter_redirects ), assigns["ran_filter"]
end
def test_before_filter_rendering_breaks_filtering_chain_for_preprend_after_filter
- response = test_process(RenderingForPrependAfterFilterController)
+ test_process(RenderingForPrependAfterFilterController)
assert_equal %w( before_filter_rendering ), assigns["ran_filter"]
assert !assigns["ran_action"]
end
def test_before_filter_redirects_breaks_filtering_chain_for_preprend_after_filter
- response = test_process(BeforeFilterRedirectionForPrependAfterFilterController)
+ test_process(BeforeFilterRedirectionForPrependAfterFilterController)
assert_response :redirect
assert_equal "http://test.host/filter_test/before_filter_redirection_for_prepend_after_filter/target_of_redirection", redirect_to_url
assert_equal %w( before_filter_redirects ), assigns["ran_filter"]
diff --git a/actionpack/test/controller/log_subscriber_test.rb b/actionpack/test/controller/log_subscriber_test.rb
index 21bbd83653..ddfa3df552 100644
--- a/actionpack/test/controller/log_subscriber_test.rb
+++ b/actionpack/test/controller/log_subscriber_test.rb
@@ -144,7 +144,7 @@ class ACLogSubscriberTest < ActionController::TestCase
wait
assert_equal 4, logs.size
- assert_match /Read fragment views\/foo/, logs[1]
+ assert_match(/Read fragment views\/foo/, logs[1])
assert_match(/Write fragment views\/foo/, logs[2])
ensure
@controller.config.perform_caching = true
@@ -156,8 +156,8 @@ class ACLogSubscriberTest < ActionController::TestCase
wait
assert_equal 4, logs.size
- assert_match /Read fragment views\/foo/, logs[1]
- assert_match /Write fragment views\/foo/, logs[2]
+ assert_match(/Read fragment views\/foo/, logs[1])
+ assert_match(/Write fragment views\/foo/, logs[2])
ensure
@controller.config.perform_caching = true
end
@@ -173,15 +173,15 @@ class ACLogSubscriberTest < ActionController::TestCase
ensure
@controller.config.perform_caching = true
end
-
+
def test_process_action_with_exception_includes_http_status_code
begin
- get :with_exception
- wait
- rescue Exception => e
- end
- assert_equal 2, logs.size
- assert_match(/Completed 500/, logs.last)
+ get :with_exception
+ wait
+ rescue Exception
+ end
+ assert_equal 2, logs.size
+ assert_match(/Completed 500/, logs.last)
end
def logs
diff --git a/actionpack/test/controller/new_base/bare_metal_test.rb b/actionpack/test/controller/new_base/bare_metal_test.rb
index 543c02b2c5..3ca29f1bcf 100644
--- a/actionpack/test/controller/new_base/bare_metal_test.rb
+++ b/actionpack/test/controller/new_base/bare_metal_test.rb
@@ -35,7 +35,7 @@ module BareMetalTest
class HeadTest < ActiveSupport::TestCase
test "head works on its own" do
- status, headers, body = HeadController.action(:index).call(Rack::MockRequest.env_for("/"))
+ status = HeadController.action(:index).call(Rack::MockRequest.env_for("/")).first
assert_equal 404, status
end
end
diff --git a/actionpack/test/controller/request/test_request_test.rb b/actionpack/test/controller/request/test_request_test.rb
index 0a39feb7fe..e624f11773 100644
--- a/actionpack/test/controller/request/test_request_test.rb
+++ b/actionpack/test/controller/request/test_request_test.rb
@@ -29,8 +29,7 @@ class ActionController::TestRequestTest < ActiveSupport::TestCase
end
def test_session_id_different_on_each_call
- prev_id =
assert_not_equal(@request.session_options[:id], ActionController::TestRequest.new.session_options[:id])
end
-end \ No newline at end of file
+end
diff --git a/actionpack/test/controller/routing_test.rb b/actionpack/test/controller/routing_test.rb
index 89f0d03c56..5f6f1b61c0 100644
--- a/actionpack/test/controller/routing_test.rb
+++ b/actionpack/test/controller/routing_test.rb
@@ -701,7 +701,7 @@ class RouteSetTest < ActiveSupport::TestCase
set.draw do
match '/users/index' => 'users#index'
end
- params = set.recognize_path('/users/index', :method => :get)
+ set.recognize_path('/users/index', :method => :get)
assert_equal 1, set.routes.size
end
@@ -980,7 +980,7 @@ class RouteSetTest < ActiveSupport::TestCase
match '/profile' => 'profile#index'
end
- params = set.recognize_path("/profile") rescue nil
+ set.recognize_path("/profile") rescue nil
assert !Object.const_defined?("Profiler__"), "Profiler should not be loaded"
end