This post originated from an RSS feed registered with Ruby Buzz
by Robby Russell.
Original Post: Testing Cookies in Ruby on Rails
Feed Title: Robby on Rails
Feed URL: http://feeds.feedburner.com/RobbyOnRails
Feed Description: Ruby on Rails development, consulting, and hosting from the trenches...
Latest Ruby Buzz Posts
Latest Ruby Buzz Posts by Robby Russell
Latest Posts From Robby on Rails
Advertisement
Over the weekend, Brian Ford released a useful plugin for testing your Ruby on Rails applications called, assert_cookie .
To use assert_cookie , follow these steps.
Install via, script/plugin install http://svn.planetargon.org/rails/plugins/assert_cookie
Fill your tests with some cookies
Test your cookies!
Here are a few examples that Brian posted.
assert_cookie :pass,
:value => lambda { |value| UUID.parse(value).valid? }
assert_cookie :yellow, :value => ['sunny', 'days']
assert_cookie :delight, :value => 'yum'
assert_cookie :secret, :path => lambda { |path| path =~ /secret/ },
:secure => true
For more information on other plugins and tools that PLANET ARGON is releasing under open source licenses, visit www.planetargon.org .
Have Fun!
Read: Testing Cookies in Ruby on Rails