mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 07:53:49 +08:00
DEV: Test theme js compiler append_raw_template (#8950)
* DEV: Test for append_raw_template * remove empty line
This commit is contained in:

committed by
GitHub

parent
a24f51278a
commit
475f545557
@ -110,4 +110,21 @@ describe ThemeJavascriptCompiler do
|
||||
end
|
||||
end
|
||||
|
||||
describe "#append_raw_template" do
|
||||
let(:compiler) { ThemeJavascriptCompiler.new(1, 'marks') }
|
||||
it 'adds the correct template to "Discourse.RAW_TEMPLATES"' do
|
||||
template = "<h1>hello</h1>"
|
||||
name = "/path/to/templates1"
|
||||
compiler.append_raw_template("#{name}.raw", template)
|
||||
expect(compiler.content.to_s).to include("Discourse.RAW_TEMPLATES[\"#{name}\"]")
|
||||
|
||||
name = "/path/to/templates2"
|
||||
compiler.append_raw_template("#{name}.hbr", template)
|
||||
expect(compiler.content.to_s).to include("Discourse.RAW_TEMPLATES[\"#{name}\"]")
|
||||
|
||||
name = "/path/to/templates3"
|
||||
compiler.append_raw_template("#{name}.hbs", template)
|
||||
expect(compiler.content.to_s).to include("Discourse.RAW_TEMPLATES[\"#{name}.hbs\"]")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user