aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_controller
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack/lib/action_controller')
-rw-r--r--actionpack/lib/action_controller/assertions/action_pack_assertions.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/actionpack/lib/action_controller/assertions/action_pack_assertions.rb b/actionpack/lib/action_controller/assertions/action_pack_assertions.rb
index 2cfbcbc938..5ffc0f90a1 100644
--- a/actionpack/lib/action_controller/assertions/action_pack_assertions.rb
+++ b/actionpack/lib/action_controller/assertions/action_pack_assertions.rb
@@ -60,6 +60,14 @@ module Test #:nodoc:
msg = build_message(message, "<?> expected in session['?'] but was <?>", expected, key, response.session[key])
assert_block(msg) { expected == response.session[key] }
end
+
+ # -- cookie assertions ---------------------------------------------------
+
+ def assert_cookie_equal(expected = nil, key = nil, message = nil)
+ response = acquire_assertion_target
+ msg = build_message(message, "<?> expected in cookies['?'] but was <?>", expected, key, response.cookies[key.to_s].first)
+ assert_block(msg) { expected == response.cookies[key.to_s].first }
+ end
# -- flash assertions ---------------------------------------------------