DEV: Add spec to guard against non-colocated component templates

This commit is contained in:
David Taylor 2023-02-14 11:24:49 +00:00
parent 8788672890
commit 1813eb4fac
1 changed files with 13 additions and 0 deletions

View File

@ -45,4 +45,17 @@ RSpec.describe "Coding style" do
check_offenses(migration_files, "TableDropper.execute_drop", "DROPPED_TABLES")
end
end
describe "non-colocated component templates" do
{
"discourse" => "app/assets/javascripts/discourse/app/templates/components",
"admin" => "app/assets/javascripts/admin/addon/templates/components",
"chat/discourse" => "plugins/chat/assets/javascripts/discourse/templates/components",
"chat/admin" => "plugins/chat/assets/javascripts/admin/templates/components",
}.each_pair do |name, dir|
it "do not exist for #{name}" do
expect(list_files(dir)).to eq([])
end
end
end
end