2009-08-17 15:55:30 -07:00
|
|
|
require File.dirname(__FILE__) + '/../../../spec_helper'
|
2009-06-07 01:37:54 -07:00
|
|
|
|
2010-09-09 17:50:38 -07:00
|
|
|
describe 'Storage.head_object' do
|
2009-08-19 19:11:57 -07:00
|
|
|
describe 'success' do
|
2009-06-07 01:37:54 -07:00
|
|
|
|
2009-08-19 20:32:57 -07:00
|
|
|
before(:each) do
|
2010-09-09 17:50:38 -07:00
|
|
|
AWS[:storage].put_bucket('fogheadobject')
|
|
|
|
AWS[:storage].put_object('fogheadobject', 'fog_head_object', lorem_file)
|
2009-08-19 19:11:57 -07:00
|
|
|
end
|
2009-06-08 15:49:24 -07:00
|
|
|
|
2009-08-19 20:32:57 -07:00
|
|
|
after(:each) do
|
2010-09-09 17:50:38 -07:00
|
|
|
AWS[:storage].delete_object('fogheadobject', 'fog_head_object')
|
|
|
|
AWS[:storage].delete_bucket('fogheadobject')
|
2009-08-19 19:11:57 -07:00
|
|
|
end
|
2009-06-08 15:49:24 -07:00
|
|
|
|
2009-08-19 19:11:57 -07:00
|
|
|
it 'should return proper attributes' do
|
2010-09-09 17:50:38 -07:00
|
|
|
actual = AWS[:storage].head_object('fogheadobject', 'fog_head_object')
|
2009-08-19 19:11:57 -07:00
|
|
|
actual.status.should == 200
|
2009-11-05 09:19:48 -08:00
|
|
|
data = lorem_file.read
|
2009-08-19 19:11:57 -07:00
|
|
|
actual.headers['Content-Length'].should == data.length.to_s
|
|
|
|
actual.headers['ETag'].should be_a(String)
|
|
|
|
actual.headers['Last-Modified'].should be_a(String)
|
|
|
|
end
|
2009-06-07 01:37:54 -07:00
|
|
|
|
2009-08-19 19:11:57 -07:00
|
|
|
end
|
|
|
|
end
|