I’ve been doing quite a bit of test driven development lately with Merb and Rspec. Tonight I banged my head against the wall for several hours trying to get cookies to pass to a strategy via a request() call. I finally got it working. I figure I would share this with the world in hopes that I save some other poor SOB hours of frustration.
Here is the code along with the strategy to give you a complete picture of what’s going on:
My first attempt at this was to setup a cookie jar using Merb::Test::CookieJar and then updating the cookies using the example.org domain. Fail! Then I scoured the web looking for any hints. When all that failed too I had to hit the Merb source code and examine what was really going on. Bingo… just pass it an array of raw cookies and let it do the rest.
Thank god for Open Source!
(BTW… I’m a bit new at both Merb and RSpec so take care with trashing my code)
I'm just your average 30 something white geeky male who rides a bike and