tests/rackspace/requests/monitoring/entity_tests.rb in fog-maestrodev-1.15.0.20130927082724 vs tests/rackspace/requests/monitoring/entity_tests.rb in fog-maestrodev-1.18.0.20131111203459
- old
+ new
@@ -2,21 +2,21 @@
account = Fog::Rackspace::Monitoring.new
entity_id = nil
tests('success') do
tests('#create new entity').formats(DATA_FORMAT) do
response = account.create_entity(:label => "Foo").data
- entity_id = response[:headers]["X-Object-ID"]
+ @entity_id = response[:headers]["X-Object-ID"]
response
end
tests('#get entity').formats(LIST_HEADERS_FORMAT) do
- account.get_entity(:entity_id => "fooid").data[:headers]
+ account.get_entity(@entity_id).data[:headers]
end
tests('#update entity').formats(DATA_FORMAT) do
options = { :metadata => {:testing => "Bar" }}
- account.update_entity(entity_id,options).data
+ account.update_entity(@entity_id,options).data
end
tests('#delete entity').formats(DELETE_DATA_FORMAT) do
- account.delete_entity(entity_id).data
+ account.delete_entity(@entity_id).data
end
end
tests('failure') do
tests('#create new entity(-1)').raises(Fog::Rackspace::Monitoring::BadRequest) do
account.create_entity(:label => "")