Close and Go BackBack to Viget

Testing Your Code’s Text

David Eisinger
David Eisinger, Senior Developer, August 31, 2011

The “Ubiquitous Automation” chapter of The Pragmatic Programmer opens with the following quote:

Civilization advances by extending the number of important operations we can perform without thinking.

–Alfred North Whitehead

As a responsible and accomplished developer, when you encounter a bug in your application, what’s the first thing you do? Write a failing test case, of course, and only once that’s done do you focus on fixing the problem. But what about when the bug is not related to the behavior of your application, but rather to its configuration, display, or some other element outside the purview of normal testing practices? I contend that you can and should still write a failing test.

Continue reading "Testing Your Code’s Text"

Stubbing Method Chains with Mocha

Ryan Foster
Ryan Foster, Web Developer, August 30, 2011

Yesterday, I came across a head scratcher trying to stub my tests with Mocha. I checked the documentation. No luck. I tried a few Google searches. Nothing obvious. The next logical step: ask around the development team. Their savvy didn't disappoint. Here's the breakdown on how to stub method chains using Mocha.

Continue reading "Stubbing Method Chains with Mocha"

PUMA on Redis

David Eisinger
David Eisinger, Senior Developer, July 27, 2011

A few weeks ago, we celebrated the launch of the new PUMA.com, the culmination of a nearly two-year effort here at Viget. The whole site is driven by a CMS written in Rails, and I’m very proud of the technological platform we’ve developed. I want to focus on one piece of that platform, Redis, and how it makes the site both rock solid and screaming fast.

Continue reading "PUMA on Redis"

Authentication in RailsAdmin with SimplestAuth

Tony Pitale
Tony Pitale, Former Staffer, July 06, 2011

See how I added administration and authentication to Opower's new website using RailsAdmin and SimplestAuth, all before lunch.

Continue reading "Authentication in RailsAdmin with SimplestAuth"

Using Javascript postMessage to Talk to iFrames

Tony Pitale
Tony Pitale, Former Staffer, July 05, 2011

To javascript, iFrames are typically black boxes. Javascript now allows cross-document communication thanks to the postMessage function. Here's how I used postMessage to get the height and width of a document in an iFrame.

Continue reading "Using Javascript postMessage to Talk to iFrames"

We're the Developers

at Viget Labs. We write about web development trends, tips, best practices, industry events, and our projects — all with an emphasis on Ruby on Rails.

Upcoming Events

Future Insights Live - April 29 to May 4
Future of Web Apps, Future of Web Design, Future of Mobile, and Future of Web in the Enterprise have joined forces to bring you our most comprehensive event EVER!

Contact Us

Have any questions, comments, ideas, or secrets to share? Let us know.


How many days in a non-leap year?

Sorry, you need to have Javascript enabled to use this form. (Don't blame us, blame the spammers!) If you'd like to contact us, please visit our Contact page.