spec/aws/models/s3/file_spec.rb in fog-0.1.8 vs spec/aws/models/s3/file_spec.rb in fog-0.1.9
- old
+ new
@@ -101,6 +101,21 @@
file.destroy
end
end
+ describe "#url" do
+
+ it "should return a signed expiring url" do
+ data = File.open(File.dirname(__FILE__) + '/../../../lorem.txt', 'r')
+ file = @directory.files.create(:key => 'fogfilename', :body => data)
+ url = file.url(Time.now + 60 * 10)
+ url.should include("fogfilename", "Expires")
+ unless Fog.mocking?
+ open(url).read.should == File.open(File.dirname(__FILE__) + '/../../../lorem.txt', 'r').read
+ end
+ file.destroy
+ end
+
+ end
+
end