From 1c79a6cc3a1b916cfabea9b6d891cdcb1d76959f Mon Sep 17 00:00:00 2001 From: Vinoth Kannan Date: Thu, 22 Aug 2019 11:02:18 +0530 Subject: [PATCH] SPEC: fix the discourse_plugin_registry spec. 41f22946c36a51c07a172e41b7dadd5555327806 --- .../discourse_plugin_registry_spec.rb | 23 +++++++------------ 1 file changed, 8 insertions(+), 15 deletions(-) diff --git a/spec/components/discourse_plugin_registry_spec.rb b/spec/components/discourse_plugin_registry_spec.rb index 2dd353e1a6a..a9104fa0551 100644 --- a/spec/components/discourse_plugin_registry_spec.rb +++ b/spec/components/discourse_plugin_registry_spec.rb @@ -153,13 +153,13 @@ describe DiscoursePluginRegistry do context '#register_asset' do let(:registry) { DiscoursePluginRegistry } + let(:plugin_directory_name) { "my_plugin" } after do registry.reset! end it "does register general css properly" do - plugin_directory_name = "my_plugin" registry.register_asset("test.css", nil, plugin_directory_name) registry.register_asset("test2.css", nil, plugin_directory_name) @@ -168,25 +168,18 @@ describe DiscoursePluginRegistry do end it "registers desktop css properly" do - registry.register_asset("test.css", :desktop) + registry.register_asset("test.css", :desktop, plugin_directory_name) - expect(registry.mobile_stylesheets.count).to eq(0) - expect(registry.desktop_stylesheets.count).to eq(1) - expect(registry.stylesheets.count).to eq(0) + expect(registry.mobile_stylesheets[plugin_directory_name].count).to eq(0) + expect(registry.desktop_stylesheets[plugin_directory_name].count).to eq(1) + expect(registry.stylesheets[plugin_directory_name].count).to eq(0) end it "registers mobile css properly" do - registry.register_asset("test.css", :mobile) + registry.register_asset("test.css", :mobile, plugin_directory_name) - expect(registry.mobile_stylesheets.count).to eq(1) - expect(registry.stylesheets.count).to eq(0) - end - - it "registers desktop css properly" do - registry.register_asset("test.css", :desktop) - - expect(registry.desktop_stylesheets.count).to eq(1) - expect(registry.stylesheets.count).to eq(0) + expect(registry.mobile_stylesheets[plugin_directory_name].count).to eq(1) + expect(registry.stylesheets[plugin_directory_name].count).to eq(0) end it "registers sass variable properly" do