Adds large image upload on subfolder install spec
This commit is contained in:
parent
c2e0eeb089
commit
c72363ebd7
|
@ -128,6 +128,39 @@ describe CookedPostProcessor do
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
context "with large images when using subfolders" do
|
||||||
|
|
||||||
|
let(:subfolder_upload) { Fabricate(:subfolder_upload) }
|
||||||
|
let(:post) { Fabricate(:post_with_large_image_on_subfolder) }
|
||||||
|
let(:cpp) { CookedPostProcessor.new(post) }
|
||||||
|
let(:base_url) { "http://test.localhost/subfolder" }
|
||||||
|
let(:base_uri) { "/subfolder" }
|
||||||
|
|
||||||
|
before do
|
||||||
|
SiteSetting.max_image_height = 2000
|
||||||
|
SiteSetting.create_thumbnails = true
|
||||||
|
Discourse.stubs(:base_url).returns(base_url)
|
||||||
|
Discourse.stubs(:base_uri).returns(base_uri)
|
||||||
|
|
||||||
|
Upload.expects(:get_from_url).returns(subfolder_upload)
|
||||||
|
FastImage.stubs(:size).returns([1000, 2000])
|
||||||
|
|
||||||
|
# hmmm this should be done in a cleaner way
|
||||||
|
OptimizedImage.expects(:resize).returns(true)
|
||||||
|
|
||||||
|
FileStore::BaseStore.any_instance.expects(:get_depth_for).returns(0)
|
||||||
|
end
|
||||||
|
|
||||||
|
it "generates overlay information" do
|
||||||
|
cpp.post_process_images
|
||||||
|
expect(cpp.html).to match_html '<p><div class="lightbox-wrapper"><a data-download-href="/subfolder/uploads/default/e9d71f5ee7c92d6dc9e92ffdad17b8bd49418f98" href="/subfolder/uploads/default/1/1234567890123456.jpg" class="lightbox" title="logo.png"><img src="/subfolder/uploads/default/optimized/1X/e9d71f5ee7c92d6dc9e92ffdad17b8bd49418f98_1_690x1380.png" width="690" height="1380"><div class="meta">
|
||||||
|
<span class="filename">logo.png</span><span class="informations">1000x2000 1.21 KB</span><span class="expand"></span>
|
||||||
|
</div></a></div></p>'
|
||||||
|
expect(cpp).to be_dirty
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
context "with title" do
|
context "with title" do
|
||||||
|
|
||||||
let(:upload) { Fabricate(:upload) }
|
let(:upload) { Fabricate(:upload) }
|
||||||
|
|
Loading…
Reference in New Issue