mirror of
https://github.com/discourse/discourse.git
synced 2025-05-30 03:08:06 +08:00
Improve specs to check top level stylesheets for SCSS compilation errors.
https://meta.discourse.org/t/fwd-growth-institute-pm-error-in-css-on-embed/66824/4
This commit is contained in:
@ -2,13 +2,16 @@ require 'rails_helper'
|
|||||||
require 'stylesheet/compiler'
|
require 'stylesheet/compiler'
|
||||||
|
|
||||||
describe Stylesheet::Compiler do
|
describe Stylesheet::Compiler do
|
||||||
it "can compile desktop mobile and desktop css" do
|
describe 'compilation' do
|
||||||
css,_map = Stylesheet::Compiler.compile_asset("desktop")
|
Dir["#{Rails.root.join("app/assets/stylesheets")}/*.scss"].each do |path|
|
||||||
expect(css.length).to be > 1000
|
path = File.basename(path, '.scss')
|
||||||
|
|
||||||
css,_map = Stylesheet::Compiler.compile_asset("mobile")
|
it "can compile '#{path}' css" do
|
||||||
|
css, _map = Stylesheet::Compiler.compile_asset(path)
|
||||||
expect(css.length).to be > 1000
|
expect(css.length).to be > 1000
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
it "supports asset-url" do
|
it "supports asset-url" do
|
||||||
css,_map = Stylesheet::Compiler.compile(".body{background-image: asset-url('foo.png');}","test.scss")
|
css,_map = Stylesheet::Compiler.compile(".body{background-image: asset-url('foo.png');}","test.scss")
|
||||||
@ -24,5 +27,3 @@ describe Stylesheet::Compiler do
|
|||||||
expect(css).not_to include('image-url')
|
expect(css).not_to include('image-url')
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user