Posts [ 3 ]

Topic: Drying shoulda functional tests

Hi,

I am trying to solve my very repetitive functional tests code - I use shoulda and its great macros, however I would like to catch the alway used parts of testing code into one place, without having neccessay to explicitely call it - the best way for me isnt another shoulda macro (like the deprecated should_be_restful, which is exactly what I mean - I want to test the basic CRUD operations on many similar controllers), I would like to use some abstract test case. Doesn't someone have a nice example? What I did is almost what I need, but for an unknown reason the tests are runned twice

Re: Drying shoulda functional tests

Cannot accomplish a successful test without including the following line at top of file before you class declaration: require File.dirname(__FILE__) + '/../../test_helper'You will also need to include the following line right after class decalaration include DesktopUnitTest