mirror of
https://github.com/discourse/discourse.git
synced 2025-09-07 12:02:53 +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:
parent
93130b15e3
commit
d3a975e99a
1 changed files with 8 additions and 7 deletions
|
@ -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
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue