[PATCH conductor 1/1] Remove name attribute from the pools index api endpoint

Crag Wolfe cwolfe at redhat.com
Wed Aug 22 16:36:25 UTC 2012


As stated by Martin, all of our collection endpoints should include id
and href attributes only, any other information should be found in a
detail endpoint (in this case, the name is available in the detail for a
given pool).
---
 src/app/views/pools/_list.xml.haml              |    2 +-
 src/features/step_definitions/pool_api_steps.rb |    9 +--------
 2 files changed, 2 insertions(+), 9 deletions(-)

diff --git a/src/app/views/pools/_list.xml.haml b/src/app/views/pools/_list.xml.haml
index 57cb421..c9c3982 100644
--- a/src/app/views/pools/_list.xml.haml
+++ b/src/app/views/pools/_list.xml.haml
@@ -1,4 +1,4 @@
 !!! XML
 %pools
   - @pools.each do |pool|
-    %pool{:id => pool.id, :name => pool.name, :href => api_pool_url(pool)}
+    %pool{:id => pool.id, :href => api_pool_url(pool)}
diff --git a/src/features/step_definitions/pool_api_steps.rb b/src/features/step_definitions/pool_api_steps.rb
index 2ffab0e..1f26b47 100644
--- a/src/features/step_definitions/pool_api_steps.rb
+++ b/src/features/step_definitions/pool_api_steps.rb
@@ -11,17 +11,10 @@ Then /^I should receive list of (\d+) pools as XML$/ do |number|
   pool_node_set = xml_body.xpath('//pools/pool')
   pool_node_set.size.should be_eql(number.to_i)
   ids = []
-  names = []
   pool_node_set.each() do |ns|
     ids << ns.get_attribute('id')
-    names << ns.get_attribute('name')
   end
-  ids.uniq!
-  names.sort!
   # verify unique id's
+  ids.uniq!
   ids.size.should be_eql(number.to_i)
-  if number == 3
-    # verify pool names match those given in the scenario
-    names.should be_eql(["Default", "bar", "foo"])
-  end
 end
-- 
1.7.1




More information about the aeolus-devel mailing list