diff --git a/test/test_helper.rb b/test/test_helper.rb index 3dbd2a4..a7e71ec 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -70,22 +70,34 @@ def reload_controller! include(WithConfig) -class ActiveSupport::TestCase - fixture_path_ = File.expand_path("./fixtures", __dir__) - - pp fixture_path_ - - if respond_to?(:fixture_paths=) - self.fixture_paths = [fixture_path_] - pp "fixture_paths", self.fixture_paths - elsif respond_to?(:fixture_path=) - self.fixture_path = fixture_path_ - pp "fixture_path", self.fixture_path - else - self.file_fixture_path = "#{fixture_path_}/files" - pp "file_fixture_path", self.file_fixture_path +module FixturePaths + def self.included(base) + base.class_eval do + fixture_path_ = File.expand_path("./fixtures", __dir__) + + pp(fixture_path_) + + if respond_to?(:fixture_paths=) + self.fixture_paths = [fixture_path_] + pp("fixture_paths", self.fixture_paths) + elsif respond_to?(:fixture_path=) + self.fixture_path = fixture_path_ + pp("fixture_path", self.fixture_path) + else + self.file_fixture_path = "#{fixture_path_}/files" + pp("file_fixture_path", self.file_fixture_path) + end + + # Load all fixtures + fixtures(:all) + end end +end + +class ActionDispatch::IntegrationTest + include FixturePaths +end - # Load all fixtures - fixtures :all +class ActiveSupport::TestCase + include FixturePaths end