On Fri, 2011-05-27 at 14:21 +0200, jprovazn(a)redhat.com wrote:
From: Jan Provaznik <jprovazn(a)redhat.com>
task #1622 (
https://www.aeolusproject.org/redmine/issues/1622)
...
+Then /^there should be these provider:$/ do |table|
+ providers = @xml_response.root.xpath('/providers/provider').map do |n|
+ {:name => n.xpath('name').text,
+ :url => n.xpath('url').text,
+ :provider_type => n.xpath('provider_type').text}
+ end
+ table.hashes.each do |hash|
+ p = providers.find {|n| n[:name] == hash[:name]}
+ p.should_not be_nil
+ p[:url].should == hash[:url]
+ p[:provider_type].should == hash[:provider_type]
+ end
+end
Nice! ACK
Cheers,
Mark.