Plugins - Foreign Key Fixtures

StarAdd to favorites

ForeignKeyFixtures

============

This plugin inserts a method into the lifecycle of a TestCase in order to clean up fixture data between different TestCase classes. This happens because the base fixtures facilities purge previous data and insert new data at the same time at when the TestCase first loads up. For example:

        TestCase1 < Test::Unit::TestCase
                fixtures :testa, :testb
        end

        TestCase2 < Test::Unit:TestCase
                fixtures :testa
        end

Where testb has a foreign key that depends upon testa, the second TestCase will fail since it will only try to delete from table testa and there are records in table testb that depend on testa.

This plugin fixes that by hooking into the end of the run method of TestSuite and deleting the fixture data. Therefore, no data stays around between the running of TestCase1 and TestCase2.

Cliff Moon

http://moonpolysoft.com:81/svn/repos/foreign_key_fixtures/trunk/

Rails' (MIT)

  • Currently 1.0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Misc. Enhancements

Tags

Comments

Add a comment

Search Plugins

Query syntax

Plugins by Category

Sponsors

Rails Kits: Get Code. Get Moving.

Have a comment?