From cf1fefe236fbba1f5346e88d6defc3a914d6e294 Mon Sep 17 00:00:00 2001 From: Neil Lalonde Date: Wed, 20 Apr 2016 15:42:13 -0400 Subject: [PATCH] add more specs for Image Lightbox on Subfolder Install --- spec/components/file_store/local_store_spec.rb | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/spec/components/file_store/local_store_spec.rb b/spec/components/file_store/local_store_spec.rb index 2ef9097a5..28f741f1a 100644 --- a/spec/components/file_store/local_store_spec.rb +++ b/spec/components/file_store/local_store_spec.rb @@ -84,12 +84,22 @@ describe FileStore::LocalStore do end + def stub_for_subfolder + GlobalSetting.stubs(:relative_url_root).returns('/forum') + Discourse.stubs(:base_uri).returns("/forum") + end + describe ".absolute_base_url" do it "is present" do expect(store.absolute_base_url).to eq("http://test.localhost/uploads/default") end + it "supports subfolder" do + stub_for_subfolder + expect(store.absolute_base_url).to eq("http://test.localhost/forum/uploads/default") + end + end describe ".relative_base_url" do @@ -98,6 +108,11 @@ describe FileStore::LocalStore do expect(store.relative_base_url).to eq("/uploads/default") end + it "supports subfolder" do + stub_for_subfolder + expect(store.relative_base_url).to eq("/forum/uploads/default") + end + end it "is internal" do