DEV: Ensure theme tests are always loaded in a consistent order (#16569)

If they aren't, then the digest will be different, causing unexpected issues
This commit is contained in:
David Taylor 2022-04-26 17:05:57 +01:00 committed by GitHub
parent 144b87b17a
commit 5e34ce1282
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -707,6 +707,7 @@ class Theme < ActiveRecord::Base
def baked_js_tests_with_digest
content = theme_fields
.where(target_id: Theme.targets[:tests_js])
.order(name: :asc)
.each(&:ensure_baked!)
.map(&:value_baked)
.join("\n")