Merge pull request #48323 from Eric-Guo/ci_fixture_vendor_no_loading

Exclude the vendor as including vendor will cause CI break after merge #48287
This commit is contained in:
Rafael Mendonça França 2023-05-30 16:02:02 -04:00 committed by GitHub
commit 6bb8bd3091
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -619,7 +619,7 @@ def load_seed
next if is_a?(Rails::Application)
fixtures = config.root.join("test", "fixtures")
if fixtures.exist? && fixtures.to_s.start_with?(Rails.root.to_s)
if fixtures_in_root_and_not_in_vendor?(fixtures)
ActiveSupport.on_load(:active_record_fixtures) { self.fixture_paths |= ["#{fixtures}/"] }
end
end
@ -727,6 +727,11 @@ def _all_load_paths(add_autoload_paths_to_load_path)
end
end
def fixtures_in_root_and_not_in_vendor?(fixtures)
fixtures.exist? && fixtures.to_s.start_with?(Rails.root.to_s) &&
!fixtures.to_s.start_with?(Rails.root.join("vendor").to_s)
end
def build_request(env)
env.merge!(env_config)
req = ActionDispatch::Request.new env