mirror of
https://github.com/discourse/discourse.git
synced 2025-05-30 07:11:34 +08:00
Theming: a UI to choose some base colors that are applied to all the site css. CSS compiled outside of asset pipeline.
This commit is contained in:
32
spec/components/discourse_stylesheets_spec.rb
Normal file
32
spec/components/discourse_stylesheets_spec.rb
Normal file
@ -0,0 +1,32 @@
|
||||
require 'spec_helper'
|
||||
require_dependency 'sass/discourse_stylesheets'
|
||||
|
||||
describe DiscourseStylesheets do
|
||||
|
||||
describe "compile" do
|
||||
it "can compile desktop bundle" do
|
||||
DiscoursePluginRegistry.stubs(:stylesheets).returns(["#{Rails.root}/spec/fixtures/scss/my_plugin.scss"])
|
||||
builder = described_class.new(:desktop)
|
||||
builder.compile.should 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)
|
||||
builder.compile.should include('my-plugin-thing')
|
||||
FileUtils.rm builder.stylesheet_fullpath
|
||||
end
|
||||
|
||||
it "can fallback when css is bad" do
|
||||
DiscoursePluginRegistry.stubs(:stylesheets).returns([
|
||||
"#{Rails.root}/spec/fixtures/scss/my_plugin.scss",
|
||||
"#{Rails.root}/spec/fixtures/scss/broken.scss"
|
||||
])
|
||||
builder = described_class.new(:desktop)
|
||||
builder.compile.should_not include('my-plugin-thing')
|
||||
FileUtils.rm builder.stylesheet_fullpath
|
||||
end
|
||||
end
|
||||
|
||||
end
|
Reference in New Issue
Block a user