views:

29

answers:

2

I encountered a situation where I've renamed a column, but was unaware that my views were still referencing the column by the old name.

This broke my web app, and I pushed these changes to my production server, thus learning the importance of a test suite.

I'm new to testing, so, I'm wondering: how I can catch problems caused by this kind of scenario?

+2  A: 

Simple: Use the view in one of your tests. After the rename, the test will fail.

Aaron Digulla
Is there a simple way to just test to make sure my controllers don't raise exceptions?
Blaine LaFreniere
Running a suite of tests sure seems simple. What simpler thing are you looking for?
S.Lott
A: 

After some research I found this article. It explains functional tests, which is what I need to test my views/actions.

The documentation on rails functional testing seems poor, but the article I linked to above is exactly what I was looking for.

I just didn't understand where/how views are supposed to be tested, alas, in the functional tests.

Blaine LaFreniere