2010-06-17 19:58:09 -04:00
|
|
|
require File.join(File.dirname(__FILE__), '..', '..', '..', 'spec_helper')
|
2010-05-27 21:27:12 -04:00
|
|
|
|
2010-06-29 17:11:35 -04:00
|
|
|
#FIXME: Make this more sane with rspec2
|
2010-06-17 19:58:09 -04:00
|
|
|
if Fog.mocking?
|
|
|
|
describe "Fog::Vcloud, initialized w/ the TMRK Ecloud module", :type => :mock_tmrk_ecloud_request do
|
|
|
|
subject { @vcloud }
|
2010-05-27 21:27:12 -04:00
|
|
|
|
2010-06-29 17:11:35 -04:00
|
|
|
it { should respond_to :delete_internet_service }
|
2010-05-27 21:27:12 -04:00
|
|
|
|
2010-06-29 17:11:35 -04:00
|
|
|
describe "#delete_internet_service" do
|
|
|
|
context "with a valid internet service uri" do
|
2010-06-30 00:15:36 -04:00
|
|
|
subject { @vcloud.delete_internet_service(@mock_service[:href]) }
|
2010-05-27 21:27:12 -04:00
|
|
|
|
2010-06-30 00:15:36 -04:00
|
|
|
it_should_behave_like "all delete responses"
|
2010-05-27 21:27:12 -04:00
|
|
|
|
2010-06-30 00:15:36 -04:00
|
|
|
let(:public_ip) { @vcloud.vdcs.first.public_ips.first }
|
|
|
|
|
|
|
|
it "should change the count by -1" do
|
|
|
|
public_ip.internet_services.length.should == 2
|
|
|
|
subject
|
|
|
|
public_ip.internet_services.reload.length.should == 1
|
|
|
|
end
|
2010-05-27 21:27:12 -04:00
|
|
|
|
2010-06-30 00:15:36 -04:00
|
|
|
describe "#body" do
|
|
|
|
its(:body) { should == '' }
|
2010-06-29 17:11:35 -04:00
|
|
|
end
|
2010-06-30 00:15:36 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
2010-06-29 17:11:35 -04:00
|
|
|
end
|
2010-05-27 21:27:12 -04:00
|
|
|
|
2010-06-29 17:11:35 -04:00
|
|
|
end
|
2010-05-27 21:27:12 -04:00
|
|
|
end
|
2010-06-17 19:58:09 -04:00
|
|
|
else
|
2010-05-27 21:27:12 -04:00
|
|
|
end
|
|
|
|
|