FIX: Text logo does not show up on non ember pages.

FIX: Text logo does not show up on non ember pages.

diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb
index 4cefbe3..1ee2f33 100644
--- a/app/helpers/application_helper.rb
+++ b/app/helpers/application_helper.rb
@@ -281,7 +281,13 @@ module ApplicationHelper
   end
 
   def application_logo_url
-    @application_logo_url ||= (mobile_view? && SiteSetting.site_mobile_logo_url).presence || SiteSetting.site_logo_url
+    @application_logo_url ||= begin
+      if mobile_view? && SiteSetting.site_mobile_logo_url
+        SiteSetting.site_mobile_logo_url
+      else
+        SiteSetting.site_home_logo_url
+      end
+    end
   end
 
   def login_path
diff --git a/spec/requests/exceptions_controller_spec.rb b/spec/requests/exceptions_controller_spec.rb
new file mode 100644
index 0000000..3ede118
--- /dev/null
+++ b/spec/requests/exceptions_controller_spec.rb
@@ -0,0 +1,37 @@
+require 'rails_helper'
+
+RSpec.describe ExceptionsController do
+  describe "#not_found" do
+    it "should return the right response" do
+      get "/404"
+
+      expect(response.status).to eq(404)
+
+      expect(response.body).to have_tag(
+        "img",
+        with: {
+          src: SiteSetting.site_home_logo_url
+        }
+      )
+    end
+
+    describe "text site logo" do
+      let(:title) { "some awesome title" }
+
+      before do
+        SiteSetting.title = title
+      end
+
+      it "should return the right response" do
+        get "/404"
+
+        expect(response.status).to eq(404)
+
+        expect(response.body).to have_tag(
+          "h2",
+          text: title
+        )
+      end
+    end
+  end
+end

GitHub sha: f89a32e7

2 Likes