aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack
diff options
context:
space:
mode:
authorXavier Noria <fxn@hashref.com>2010-08-17 03:29:57 +0200
committerXavier Noria <fxn@hashref.com>2010-08-17 03:32:11 +0200
commitfb6b80562041e8d2378cad1b51f8c234fe76fd5e (patch)
treee407af937ad119b1a5a6c977b13319f24994cde2 /actionpack
parentd14e2987b583a3dcb6836d310f77ce367c7396f8 (diff)
downloadrails-fb6b80562041e8d2378cad1b51f8c234fe76fd5e.tar.gz
rails-fb6b80562041e8d2378cad1b51f8c234fe76fd5e.tar.bz2
rails-fb6b80562041e8d2378cad1b51f8c234fe76fd5e.zip
code gardening: we have assert_(nil|blank|present), more concise, with better default failure messages - let's use them
Diffstat (limited to 'actionpack')
-rw-r--r--actionpack/test/controller/output_escaping_test.rb2
-rw-r--r--actionpack/test/controller/render_test.rb12
-rw-r--r--actionpack/test/controller/request_forgery_protection_test.rb2
-rw-r--r--actionpack/test/controller/test_test.rb2
-rw-r--r--actionpack/test/controller/webservice_test.rb4
-rw-r--r--actionpack/test/template/atom_feed_helper_test.rb2
6 files changed, 12 insertions, 12 deletions
diff --git a/actionpack/test/controller/output_escaping_test.rb b/actionpack/test/controller/output_escaping_test.rb
index 43a8c05cda..f6913a2138 100644
--- a/actionpack/test/controller/output_escaping_test.rb
+++ b/actionpack/test/controller/output_escaping_test.rb
@@ -3,7 +3,7 @@ require 'abstract_unit'
class OutputEscapingTest < ActiveSupport::TestCase
test "escape_html shouldn't die when passed nil" do
- assert ERB::Util.h(nil).blank?
+ assert_blank ERB::Util.h(nil)
end
test "escapeHTML should escape strings" do
diff --git a/actionpack/test/controller/render_test.rb b/actionpack/test/controller/render_test.rb
index 258f511f10..9037a13343 100644
--- a/actionpack/test/controller/render_test.rb
+++ b/actionpack/test/controller/render_test.rb
@@ -1113,7 +1113,7 @@ class RenderTest < ActionController::TestCase
def test_head_with_location_header
get :head_with_location_header
- assert @response.body.blank?
+ assert_blank @response.body
assert_equal "/foo", @response.headers["Location"]
assert_response :ok
end
@@ -1126,7 +1126,7 @@ class RenderTest < ActionController::TestCase
end
get :head_with_location_object
- assert @response.body.blank?
+ assert_blank @response.body
assert_equal "http://www.nextangle.com/customers/1", @response.headers["Location"]
assert_response :ok
end
@@ -1134,7 +1134,7 @@ class RenderTest < ActionController::TestCase
def test_head_with_custom_header
get :head_with_custom_header
- assert @response.body.blank?
+ assert_blank @response.body
assert_equal "something", @response.headers["X-Custom-Header"]
assert_response :ok
end
@@ -1414,7 +1414,7 @@ class EtagRenderTest < ActionController::TestCase
assert_equal 200, @response.status.to_i
assert_not_nil @response.last_modified
assert_nil @response.etag
- assert @response.body.present?
+ assert_present @response.body
end
def test_render_with_etag
@@ -1499,7 +1499,7 @@ class LastModifiedRenderTest < ActionController::TestCase
@request.if_modified_since = @last_modified
get :conditional_hello
assert_equal 304, @response.status.to_i
- assert @response.body.blank?, @response.body
+ assert_blank @response.body
assert_equal @last_modified, @response.headers['Last-Modified']
end
@@ -1514,7 +1514,7 @@ class LastModifiedRenderTest < ActionController::TestCase
@request.if_modified_since = 'Thu, 16 Jul 2008 00:00:00 GMT'
get :conditional_hello
assert_equal 200, @response.status.to_i
- assert !@response.body.blank?
+ assert_present @response.body
assert_equal @last_modified, @response.headers['Last-Modified']
end
diff --git a/actionpack/test/controller/request_forgery_protection_test.rb b/actionpack/test/controller/request_forgery_protection_test.rb
index be05ef6167..5ec760d4ea 100644
--- a/actionpack/test/controller/request_forgery_protection_test.rb
+++ b/actionpack/test/controller/request_forgery_protection_test.rb
@@ -251,7 +251,7 @@ class FreeCookieControllerTest < ActionController::TestCase
test 'should not emit a csrf-token meta tag' do
get :meta
- assert @response.body.blank?
+ assert_blank @response.body
end
end
diff --git a/actionpack/test/controller/test_test.rb b/actionpack/test/controller/test_test.rb
index 7e7e4bd463..de2cab3e79 100644
--- a/actionpack/test/controller/test_test.rb
+++ b/actionpack/test/controller/test_test.rb
@@ -546,7 +546,7 @@ XML
assert_equal "bar", @request.params[:foo]
@request.recycle!
post :no_op
- assert @request.params[:foo].blank?
+ assert_blank @request.params[:foo]
end
def test_should_have_knowledge_of_client_side_cookie_state_even_if_they_are_not_set
diff --git a/actionpack/test/controller/webservice_test.rb b/actionpack/test/controller/webservice_test.rb
index 5942950b15..2e6cf48406 100644
--- a/actionpack/test/controller/webservice_test.rb
+++ b/actionpack/test/controller/webservice_test.rb
@@ -29,7 +29,7 @@ class WebServiceTest < ActionController::IntegrationTest
def test_check_parameters
with_test_route_set do
get "/"
- assert @controller.response.body.blank?
+ assert_blank @controller.response.body
end
end
@@ -161,7 +161,7 @@ class WebServiceTest < ActionController::IntegrationTest
def test_use_xml_ximple_with_empty_request
with_test_route_set do
assert_nothing_raised { post "/", "", {'CONTENT_TYPE' => 'application/xml'} }
- assert @controller.response.body.blank?
+ assert_blank @controller.response.body
end
end
diff --git a/actionpack/test/template/atom_feed_helper_test.rb b/actionpack/test/template/atom_feed_helper_test.rb
index 869ea22469..fb43a8f960 100644
--- a/actionpack/test/template/atom_feed_helper_test.rb
+++ b/actionpack/test/template/atom_feed_helper_test.rb
@@ -226,7 +226,7 @@ class AtomFeedTest < ActionController::TestCase
get :index, :id=>"provide_builder"
# because we pass in the non-default builder, the content generated by the
# helper should go 'nowhere'. Leaving the response body blank.
- assert @response.body.blank?
+ assert_blank @response.body
end
end