2009-08-17 15:55:30 -07:00
|
|
|
require File.dirname(__FILE__) + '/../../../spec_helper'
|
2009-06-07 01:55:52 -07:00
|
|
|
|
2010-09-09 17:50:38 -07:00
|
|
|
describe 'Storage.put_request_payment' do
|
2009-08-19 20:32:57 -07:00
|
|
|
describe 'success' do
|
2009-06-07 01:55:52 -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('fogputrequestpayment')
|
2009-08-19 19:11:57 -07:00
|
|
|
end
|
2009-06-25 00:32:27 -07:00
|
|
|
|
2009-08-19 20:32:57 -07:00
|
|
|
after(:each) do
|
2010-09-09 17:50:38 -07:00
|
|
|
AWS[:storage].delete_bucket('fogputrequestpayment')
|
2009-08-19 19:11:57 -07:00
|
|
|
end
|
2009-06-25 00:32:27 -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].put_request_payment('fogputrequestpayment', 'Requester')
|
2009-08-19 19:11:57 -07:00
|
|
|
actual.status.should == 200
|
|
|
|
end
|
2009-06-07 01:55:52 -07:00
|
|
|
|
2009-08-16 13:31:36 -07:00
|
|
|
end
|
2009-08-19 19:11:57 -07:00
|
|
|
describe 'failure' do
|
2009-08-16 13:31:36 -07:00
|
|
|
|
2009-08-19 19:11:57 -07:00
|
|
|
it 'should raise a NotFound error if bucket does not exist' do
|
|
|
|
lambda {
|
2010-09-09 17:50:38 -07:00
|
|
|
AWS[:storage].put_request_payment('fognotabucket', 'Requester')
|
2009-10-31 12:26:49 -07:00
|
|
|
}.should raise_error(Excon::Errors::NotFound)
|
2009-08-19 19:11:57 -07:00
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|