Passing Sessions and Referers in Rails Functional Tests So, you’ve set up your Rails app to present different views to authenticated people verses non. Now, how do you test functionality for the authenticated people?
Seems silly to have your tests sign in before checking whatever it is you want them to check.
Well, pass the session data in the test as a hash. Turns
Learning Ruby - Day 5
Day 5 is all about objects and their methods.
Remember a few months back when Apple introduced the Shuffle? Everyone was up-in-arms about it’s lack of screen and how it was useless an mp3 player without a screen is. When in-fact, the lack of screen simplifies and improves the device a great deal.
Ruby is like
MySQL on OS X Reinstall Reminders First off, if you can avoid reinstalling MySQL on OS X - by all means do. Whatever the reason is that you want to do a reinstall, it’s not a good one1. Just buck up and work around whatever issue you have. It’s not as bad as what follows.
Let’s say you decide to reinstall anyway.
Learning Ruby - Day 6
Day 6, How to deal with files and other data streams.
What’s a reliable way to get the last item in an array? ask for the -1 item, i.e. array[-1].
Finally, a logical reason to start arrays at 0 rather than 1 - so we can count backwards.
Looks like the “then” part of an “if…then” statement
Learning Ruby - Day 12
Day 12 - When repeating yourself is the preferred method is repeating yourself.
Today’s topic is recursion - iteratively calling a function numerous times with a single minor change. On face value, it sounds like something computer technology should help us avoid. In addition, it seems to directly conflict the Ruby on Rails mantra Don’t