Hi,
I want to reset the fixture data manually during a single test. I know this action is performed between tests, but I need to trigger it within a single test.
I need this because I have a directory full of test data (xml files) which need to be sent to the application and validated for their response. These files are all sent to a single controller action, which dispatches the request to the appropriate Restful controller/ action. This controller mainly exists for backward compatibility reasons which do not map to Restful controllers. I already have tests on the Restful controller actions, but I want to run this dispatching test as well. So what I do now is create a single test which iterates over all these files and after each run reset! the session for the next run.
class DispatcherControllerTest < Test::Unit::TestCase
def test_all_xml_files all_files.each do |file| post :submit, file ...assertions... reset! end end
end
The problem is that the submitted files change the state of the application. I don't want the tests to be dependent of each other so I want to reset the fixture data after each iteration, but I can't find the method to do this.
Does anybody know how to reset the fixtures manually during a single test?
Thanks in advance, Bas van Westing