Skip to content

Commit

Permalink
Add a repair_helper to repair changes to the validations inside valid…
Browse files Browse the repository at this point in the history
…ations_test.rb [#674 state:resolved]

Many of the tests in validations_test would add a new validation to
models.  However, only Topic was being reset with a fairly aggressive
clearing of all validations.  None of the other models being used however
were recieving the same treatment.  Now we use repair_validations(Topic)
for the whole test case because most test cases use Topic and then the
block form of repair_validations(<other_models>) inside any tests that use
other models.

Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
  • Loading branch information
h-lame authored and lifo committed Dec 19, 2008
1 parent c044c07 commit 8a92cdc
Show file tree
Hide file tree
Showing 2 changed files with 195 additions and 160 deletions.
4 changes: 4 additions & 0 deletions activerecord/test/cases/helper.rb
Expand Up @@ -9,6 +9,8 @@
require 'active_record/fixtures'
require 'connection'

require 'cases/repair_helper'

# Show backtraces for deprecated behavior for quicker cleanup.
ActiveSupport::Deprecation.debug = true

Expand Down Expand Up @@ -60,6 +62,8 @@ def try_to_load_dependency_with_silence(*args)

class ActiveSupport::TestCase
include ActiveRecord::TestFixtures
include ActiveRecord::Testing::RepairHelper

self.fixture_path = FIXTURES_ROOT
self.use_instantiated_fixtures = false
self.use_transactional_fixtures = true
Expand Down

0 comments on commit 8a92cdc

Please sign in to comment.