If you want to make sure an exception is thrown in a Rails test just use the assert_raise assertion. For example, I am testing to make sure the SQL statement is invalid after it goes through my model’s validation def test_exception c = Content.new # Title is missing assert_raise ActiveRecord::StatementInvalid do c.save end end This [...]
Archive | July, 2007
Starting a software company
Well as of last month I decided to finally create a software company and see what I can turn it into. Starting out I will be focusing on consulting but will eventually try to turn it into a product based company. I will try to post about my progress on the blog here, mostly to [...]
Subscribe to updates
9 Day Rails Controller Refactoring Course
Do you have some crufty Rails controllers? Are they getting too fat and need to be slimmed down?
Sign up below for the free 9 day email course on how you can refactor your Rails controllers. You don't have to live with bad code.
