mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FEATURE: adds support for loading existing core asset in pretty text
This commit is contained in:
@@ -168,6 +168,13 @@ describe DiscoursePluginRegistry do
|
||||
expect(registry.admin_javascripts.count).to eq(1)
|
||||
expect(registry.javascripts.count).to eq(0)
|
||||
end
|
||||
|
||||
it "registers vendored_core_pretty_text properly" do
|
||||
registry.register_asset("my_lib.js", :vendored_core_pretty_text)
|
||||
|
||||
expect(registry.vendored_core_pretty_text.count).to eq(1)
|
||||
expect(registry.javascripts.count).to eq(0)
|
||||
end
|
||||
end
|
||||
|
||||
context '#register_seed_data' do
|
||||
|
||||
@@ -93,6 +93,15 @@ describe Plugin::Instance do
|
||||
expect(DiscoursePluginRegistry.mobile_stylesheets.count).to eq(0)
|
||||
expect(DiscoursePluginRegistry.stylesheets.count).to eq(2)
|
||||
end
|
||||
|
||||
it "remaps vendored_core_pretty_text asset" do
|
||||
plugin = Plugin::Instance.new nil, "/tmp/test.rb"
|
||||
plugin.register_asset("moment.js", :vendored_core_pretty_text)
|
||||
|
||||
plugin.send :register_assets!
|
||||
|
||||
expect(DiscoursePluginRegistry.vendored_core_pretty_text.first).to eq("lib/javascripts/moment.js")
|
||||
end
|
||||
end
|
||||
|
||||
context "register service worker" do
|
||||
|
||||
Reference in New Issue
Block a user