mirror of
https://github.com/discourse/discourse.git
synced 2025-09-07 12:02:53 +08:00
refactor CookedPostProcessor & specs
This commit is contained in:
parent
c6c8246399
commit
ac7253a938
6 changed files with 313 additions and 277 deletions
|
@ -10,20 +10,19 @@ describe OptimizedImage do
|
|||
describe ".create_for" do
|
||||
|
||||
before(:each) do
|
||||
ImageSorcery.any_instance.stubs(:convert).returns(true)
|
||||
FastImage.any_instance.stubs(:size).returns([244, 66])
|
||||
ImageSorcery.any_instance.expects(:convert).returns(true)
|
||||
# make sure we don't hit the filesystem
|
||||
FileUtils.stubs(:mkdir_p)
|
||||
File.stubs(:open)
|
||||
end
|
||||
|
||||
it "works" do
|
||||
Tempfile.any_instance.expects(:close).once
|
||||
Tempfile.any_instance.expects(:unlink).once
|
||||
Tempfile.any_instance.expects(:close)
|
||||
Tempfile.any_instance.expects(:unlink)
|
||||
oi.sha1.should == "da39a3ee5e6b4b0d3255bfef95601890afd80709"
|
||||
oi.extension.should == ".jpg"
|
||||
oi.width.should == 244
|
||||
oi.height.should == 66
|
||||
oi.width.should == 100
|
||||
oi.height.should == 100
|
||||
end
|
||||
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue