From db77300076a7fdb6344ea743e8b73486b5f26172 Mon Sep 17 00:00:00 2001 From: Dan Prince Date: Thu, 29 Nov 2012 21:30:58 -0500 Subject: [PATCH] OpenStack: security group test fixes. Update the OpenStack security group test to support the correct format for create_security_group responses. This patch removes the extra [] wrapping the response and makes it so the real tests run once again. Also updates the existing Mock for create_security_response so it handles it properly as well. --- lib/fog/openstack/requests/compute/create_security_group.rb | 2 +- tests/openstack/requests/compute/security_group_tests.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/fog/openstack/requests/compute/create_security_group.rb b/lib/fog/openstack/requests/compute/create_security_group.rb index e114f5f0b..106824e3e 100644 --- a/lib/fog/openstack/requests/compute/create_security_group.rb +++ b/lib/fog/openstack/requests/compute/create_security_group.rb @@ -41,7 +41,7 @@ module Fog 'Content-Length' => Fog::Mock.random_numbers(3).to_s, 'Date' => Date.new} response.body = { - 'security_group' => self.data[:security_groups].values + 'security_group' => self.data[:security_groups][security_group_id] } response end diff --git a/tests/openstack/requests/compute/security_group_tests.rb b/tests/openstack/requests/compute/security_group_tests.rb index f6f9edc58..a4c4bed1a 100644 --- a/tests/openstack/requests/compute/security_group_tests.rb +++ b/tests/openstack/requests/compute/security_group_tests.rb @@ -20,7 +20,7 @@ Shindo.tests('Fog::Compute[:openstack] | security group requests', ['openstack'] } tests('success') do - tests('#create_security_group(name, description)').formats({"security_group" => [@security_group_format]}) do + tests('#create_security_group(name, description)').formats({"security_group" => @security_group_format}) do Fog::Compute[:openstack].create_security_group('from_shindo_test', 'this is from the shindo test').body end