RSpec seems to make such intuitive sense, and now that I've started to wrap my head around TDD, I am starting to see the benefit.  Sure, initial development may be slower, but the overall development approach should help over the long-term maintenance of your code.

But then, RSpec completely stumped me. 

Thanks to the folks at StackOverflow, because this post, explains my problem exactly.  After multiple tries, my test just wouldn't work.  But with this explanation, I started wondering how the "click_link ...." test was working.  Then it hit me:  each "click_link" represents a user click, so the following test is now looking at the new page (just "clicked") and not the path I had specified above.  AHA!

Very interesting (and, sadly, unintuitive for the newbie).
 


Comments


Your comment will be posted after it is approved.


Leave a Reply