mirror of
https://github.com/discourse/discourse.git
synced 2025-05-31 21:25:24 +08:00
PERF: don't recompile css files that have already been compiled
This commit is contained in:
@ -7,14 +7,14 @@ describe DiscourseStylesheets do
|
||||
it "can compile desktop bundle" do
|
||||
DiscoursePluginRegistry.stubs(:stylesheets).returns(["#{Rails.root}/spec/fixtures/scss/my_plugin.scss"])
|
||||
builder = described_class.new(:desktop)
|
||||
expect(builder.compile).to include('my-plugin-thing')
|
||||
expect(builder.compile(force: true)).to include('my-plugin-thing')
|
||||
FileUtils.rm builder.stylesheet_fullpath
|
||||
end
|
||||
|
||||
it "can compile mobile bundle" do
|
||||
DiscoursePluginRegistry.stubs(:mobile_stylesheets).returns(["#{Rails.root}/spec/fixtures/scss/my_plugin.scss"])
|
||||
builder = described_class.new(:mobile)
|
||||
expect(builder.compile).to include('my-plugin-thing')
|
||||
expect(builder.compile(force: true)).to include('my-plugin-thing')
|
||||
FileUtils.rm builder.stylesheet_fullpath
|
||||
end
|
||||
|
||||
@ -24,7 +24,7 @@ describe DiscourseStylesheets do
|
||||
"#{Rails.root}/spec/fixtures/scss/broken.scss"
|
||||
])
|
||||
builder = described_class.new(:desktop)
|
||||
expect(builder.compile).not_to include('my-plugin-thing')
|
||||
expect(builder.compile(force: true)).not_to include('my-plugin-thing')
|
||||
FileUtils.rm builder.stylesheet_fullpath
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user