spec/utils_spec.rb in cloudinary-1.0.72 vs spec/utils_spec.rb in cloudinary-1.0.73

- old
+ new

@@ -463,6 +463,18 @@ it "should correctly sign_request" do params = Cloudinary::Utils.sign_request({:public_id=>"folder/file", :version=>"1234"}) params.should == {:public_id=>"folder/file", :version=>"1234", :signature=>"7a3349cbb373e4812118d625047ede50b90e7b67", :api_key=>"1234"} end + + it "should support responsive width" do + options = {:width=>100, :height=>100, :crop=>:crop, :responsive_width=>true} + result = Cloudinary::Utils.cloudinary_url("test", options) + options.should == {responsive: true} + result.should == "http://res.cloudinary.com/test123/image/upload/c_crop,h_100,w_100/c_limit,w_auto/test" + Cloudinary.config.responsive_width_transformation = {width: :auto, crop: :pad} + options = {:width=>100, :height=>100, :crop=>:crop, :responsive_width=>true} + result = Cloudinary::Utils.cloudinary_url("test", options) + options.should == {responsive: true} + result.should == "http://res.cloudinary.com/test123/image/upload/c_crop,h_100,w_100/c_pad,w_auto/test" + end end