aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/dispatch
diff options
context:
space:
mode:
authorAkira Matsuda <ronnie@dio.jp>2014-08-18 15:29:21 +0900
committerAkira Matsuda <ronnie@dio.jp>2014-08-18 15:40:53 +0900
commitb30b99c6158766a6b09e8d3b1f91938fc0884605 (patch)
treeb741a757203feda9bd68d8783983c55378527c2c /actionpack/test/dispatch
parent87228a207cdbeea8663a41ef86d661575522e957 (diff)
downloadrails-b30b99c6158766a6b09e8d3b1f91938fc0884605.tar.gz
rails-b30b99c6158766a6b09e8d3b1f91938fc0884605.tar.bz2
rails-b30b99c6158766a6b09e8d3b1f91938fc0884605.zip
Expectations first
Diffstat (limited to 'actionpack/test/dispatch')
-rw-r--r--actionpack/test/dispatch/cookies_test.rb2
-rw-r--r--actionpack/test/dispatch/debug_exceptions_test.rb12
-rw-r--r--actionpack/test/dispatch/mime_type_test.rb2
-rw-r--r--actionpack/test/dispatch/session/cookie_store_test.rb6
4 files changed, 11 insertions, 11 deletions
diff --git a/actionpack/test/dispatch/cookies_test.rb b/actionpack/test/dispatch/cookies_test.rb
index 9b03c805a0..f62e194ca9 100644
--- a/actionpack/test/dispatch/cookies_test.rb
+++ b/actionpack/test/dispatch/cookies_test.rb
@@ -283,7 +283,7 @@ class CookiesTest < ActionController::TestCase
def test_setting_the_same_value_to_permanent_cookie
request.cookies[:user_name] = 'Jamie'
get :set_permanent_cookie
- assert_equal response.cookies, 'user_name' => 'Jamie'
+ assert_equal({'user_name' => 'Jamie'}, response.cookies)
end
def test_setting_with_escapable_characters
diff --git a/actionpack/test/dispatch/debug_exceptions_test.rb b/actionpack/test/dispatch/debug_exceptions_test.rb
index 24526fb00e..0add9fa3b0 100644
--- a/actionpack/test/dispatch/debug_exceptions_test.rb
+++ b/actionpack/test/dispatch/debug_exceptions_test.rb
@@ -151,37 +151,37 @@ class DebugExceptionsTest < ActionDispatch::IntegrationTest
assert_response 500
assert_no_match(/<header>/, body)
assert_no_match(/<body>/, body)
- assert_equal response.content_type, "text/plain"
+ assert_equal "text/plain", response.content_type
assert_match(/RuntimeError\npuke/, body)
get "/not_found", {}, xhr_request_env
assert_response 404
assert_no_match(/<body>/, body)
- assert_equal response.content_type, "text/plain"
+ assert_equal "text/plain", response.content_type
assert_match(/#{AbstractController::ActionNotFound.name}/, body)
get "/method_not_allowed", {}, xhr_request_env
assert_response 405
assert_no_match(/<body>/, body)
- assert_equal response.content_type, "text/plain"
+ assert_equal "text/plain", response.content_type
assert_match(/ActionController::MethodNotAllowed/, body)
get "/unknown_http_method", {}, xhr_request_env
assert_response 405
assert_no_match(/<body>/, body)
- assert_equal response.content_type, "text/plain"
+ assert_equal "text/plain", response.content_type
assert_match(/ActionController::UnknownHttpMethod/, body)
get "/bad_request", {}, xhr_request_env
assert_response 400
assert_no_match(/<body>/, body)
- assert_equal response.content_type, "text/plain"
+ assert_equal "text/plain", response.content_type
assert_match(/ActionController::BadRequest/, body)
get "/parameter_missing", {}, xhr_request_env
assert_response 400
assert_no_match(/<body>/, body)
- assert_equal response.content_type, "text/plain"
+ assert_equal "text/plain", response.content_type
assert_match(/ActionController::ParameterMissing/, body)
end
diff --git a/actionpack/test/dispatch/mime_type_test.rb b/actionpack/test/dispatch/mime_type_test.rb
index d29cc8473e..7f340ced41 100644
--- a/actionpack/test/dispatch/mime_type_test.rb
+++ b/actionpack/test/dispatch/mime_type_test.rb
@@ -124,7 +124,7 @@ class MimeTypeTest < ActiveSupport::TestCase
end
Mime::Type.register("text/foo", :foo)
- assert_equal registered_mimes, [Mime::FOO]
+ assert_equal [Mime::FOO], registered_mimes
ensure
Mime::Type.unregister(:FOO)
end
diff --git a/actionpack/test/dispatch/session/cookie_store_test.rb b/actionpack/test/dispatch/session/cookie_store_test.rb
index e99ff46edf..c5cd24d06e 100644
--- a/actionpack/test/dispatch/session/cookie_store_test.rb
+++ b/actionpack/test/dispatch/session/cookie_store_test.rb
@@ -86,7 +86,7 @@ class CookieStoreTest < ActionDispatch::IntegrationTest
cookies[SessionKey] = SignedBar
get '/persistent_session_id'
assert_response :success
- assert_equal response.body.size, 32
+ assert_equal 32, response.body.size
session_id = response.body
get '/get_session_id'
@@ -247,7 +247,7 @@ class CookieStoreTest < ActionDispatch::IntegrationTest
cookies[SessionKey] = SignedBar
get '/persistent_session_id'
assert_response :success
- assert_equal response.body.size, 32
+ assert_equal 32, response.body.size
session_id = response.body
get '/persistent_session_id'
assert_equal session_id, response.body
@@ -263,7 +263,7 @@ class CookieStoreTest < ActionDispatch::IntegrationTest
get "/get_session_id"
sid = response.body
- assert_equal sid.size, 36
+ assert_equal 36, sid.size
get "/change_session_id"
assert_not_equal sid, response.body