From d3a975e99a12a009cf6856de2512546264d6d952 Mon Sep 17 00:00:00 2001 From: Guo Xiang Tan Date: Wed, 26 Jul 2017 10:49:39 +0900 Subject: [PATCH] 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 --- spec/components/stylesheet/compiler_spec.rb | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/spec/components/stylesheet/compiler_spec.rb b/spec/components/stylesheet/compiler_spec.rb index c19a4169bd5..6a0e1e50101 100644 --- a/spec/components/stylesheet/compiler_spec.rb +++ b/spec/components/stylesheet/compiler_spec.rb @@ -2,12 +2,15 @@ require 'rails_helper' require 'stylesheet/compiler' describe Stylesheet::Compiler do - it "can compile desktop mobile and desktop css" do - css,_map = Stylesheet::Compiler.compile_asset("desktop") - expect(css.length).to be > 1000 + describe 'compilation' do + Dir["#{Rails.root.join("app/assets/stylesheets")}/*.scss"].each do |path| + path = File.basename(path, '.scss') - css,_map = Stylesheet::Compiler.compile_asset("mobile") - expect(css.length).to be > 1000 + it "can compile '#{path}' css" do + css, _map = Stylesheet::Compiler.compile_asset(path) + expect(css.length).to be > 1000 + end + end end it "supports asset-url" do @@ -24,5 +27,3 @@ describe Stylesheet::Compiler do expect(css).not_to include('image-url') end end - -