add more specs for Image Lightbox on Subfolder Install
This commit is contained in:
parent
4960b62110
commit
cf1fefe236
|
@ -84,12 +84,22 @@ describe FileStore::LocalStore do
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def stub_for_subfolder
|
||||||
|
GlobalSetting.stubs(:relative_url_root).returns('/forum')
|
||||||
|
Discourse.stubs(:base_uri).returns("/forum")
|
||||||
|
end
|
||||||
|
|
||||||
describe ".absolute_base_url" do
|
describe ".absolute_base_url" do
|
||||||
|
|
||||||
it "is present" do
|
it "is present" do
|
||||||
expect(store.absolute_base_url).to eq("http://test.localhost/uploads/default")
|
expect(store.absolute_base_url).to eq("http://test.localhost/uploads/default")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
it "supports subfolder" do
|
||||||
|
stub_for_subfolder
|
||||||
|
expect(store.absolute_base_url).to eq("http://test.localhost/forum/uploads/default")
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
describe ".relative_base_url" do
|
describe ".relative_base_url" do
|
||||||
|
@ -98,6 +108,11 @@ describe FileStore::LocalStore do
|
||||||
expect(store.relative_base_url).to eq("/uploads/default")
|
expect(store.relative_base_url).to eq("/uploads/default")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
it "supports subfolder" do
|
||||||
|
stub_for_subfolder
|
||||||
|
expect(store.relative_base_url).to eq("/forum/uploads/default")
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
it "is internal" do
|
it "is internal" do
|
||||||
|
|
Loading…
Reference in New Issue