Commit 05909057 by Juanjo Bazán

More fine-grained tests for thumbnail.

parent 169dee4d
...@@ -113,10 +113,9 @@ class ThumbnailTest < Test::Unit::TestCase ...@@ -113,10 +113,9 @@ class ThumbnailTest < Test::Unit::TestCase
end end
should "send the right command to convert when sent #make" do should "send the right command to convert when sent #make" do
Paperclip.expects(:run).with do |*arg| @thumb.expects(:convert).with do |*arg|
arg[0] == 'convert' && arg[0] == ':source -resize "x50" -crop "100x50+114+0" +repage :dest' &&
arg[1] == ':source -resize "x50" -crop "100x50+114+0" +repage :dest' && arg[1][:source] == "#{File.expand_path(@thumb.file.path)}[0]"
arg[2][:source] == "#{File.expand_path(@thumb.file.path)}[0]"
end end
@thumb.make @thumb.make
end end
...@@ -139,10 +138,9 @@ class ThumbnailTest < Test::Unit::TestCase ...@@ -139,10 +138,9 @@ class ThumbnailTest < Test::Unit::TestCase
end end
should "send the right command to convert when sent #make" do should "send the right command to convert when sent #make" do
Paperclip.expects(:run).with do |*arg| @thumb.expects(:convert).with do |*arg|
arg[0] == 'convert' && arg[0] == '-strip :source -resize "x50" -crop "100x50+114+0" +repage :dest' &&
arg[1] == '-strip :source -resize "x50" -crop "100x50+114+0" +repage :dest' && arg[1][:source] == "#{File.expand_path(@thumb.file.path)}[0]"
arg[2][:source] == "#{File.expand_path(@thumb.file.path)}[0]"
end end
@thumb.make @thumb.make
end end
...@@ -181,10 +179,9 @@ class ThumbnailTest < Test::Unit::TestCase ...@@ -181,10 +179,9 @@ class ThumbnailTest < Test::Unit::TestCase
end end
should "send the right command to convert when sent #make" do should "send the right command to convert when sent #make" do
Paperclip.expects(:run).with do |*arg| @thumb.expects(:convert).with do |*arg|
arg[0] == 'convert' && arg[0] == ':source -resize "x50" -crop "100x50+114+0" +repage -strip -depth 8 :dest' &&
arg[1] == ':source -resize "x50" -crop "100x50+114+0" +repage -strip -depth 8 :dest' && arg[1][:source] == "#{File.expand_path(@thumb.file.path)}[0]"
arg[2][:source] == "#{File.expand_path(@thumb.file.path)}[0]"
end end
@thumb.make @thumb.make
end end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment