[PATCH conductor 00/11] Providers API - index, show, create

Martyn Taylor mtaylor at redhat.com
Thu May 10 10:29:48 UTC 2012


On 05/08/2012 06:45 PM, pblaho at redhat.com wrote:
> https://www.aeolusproject.org/redmine/issues/3170
>
> This series adds XML respond_to block for index, show and create actions
> of ProvidersController
>
> Rspec tests and feature with step definitions included.
Hi Petr,

There are some issues with this patch set.  I've given some general 
notes then some specific patch issues.

Can you please fix and resend.

Thanks

Martyn


1) 09/11 in the series breaks the spec and cucumber tests, this is tells 
me that specs have not been run after this point.  You should always run 
specs and cucumber tests on the top commit at the very least.  i.e. 11/11

2) You should be checking the contents of the XML documents in the spec 
tests.  For example, you should check that the documents return the 
correct provider url, name etc...

3) I'm not 100% convinced we should be using nokogiri for testing 
responses in cucumber tests.  I'm happy for this to go in for now.  Next 
sprint we should have some discussion on best practice for this.

4) Creating a new provider does not work: --

request

$ [martyn at martyn-work-laptop src]$ curl -X POST --user admin:password 
--header "Accept: application/xml" --data 
"<provider><url>http://localhost:3002/api</url><name>testing</name><provider_type>ec2</provider_type><deltacloud_provider></deltacloud_provider></provider>" 
http://localhost:3000/providers

response

<?xml version="1.0" encoding="UTF-8"?>
<hash>
<message>undefined method `has_key?' for nil:NilClass</message>
</hash>

This should either return success or an xml error in body

5) Updating a provider does not work

$ curl --user admin:password --header "Accept: application/xml" 
http://localhost:3000/providers/2

<provider href='http://localhost:3000/api/providers/2' id='2'>
<name>ec2-us-east-1</name>
<url>http://localhost:3002/api</url>
<provider_type>ec2</provider_type>
<deltacloud_provider></deltacloud_provider>
</provider>

request
$ curl -X PUT --user admin:password --header "Accept: application/xml" 
--data 
"<provider><url>http://localhost:3002/api</url><name>testing</name><provider_type>ec2</provider_type></provider>" 
http://localhost:3000/providers/2

response
<html><body>You are being <a 
href="http://localhost:3000/providers/2/edit">redirected</a>.</body></html>


---- Patche Issues ----
- 01 - Moved "I am an authorized user to user"

* Does not remove the step from pool step

- 02 - Feature for Providers API - index action

Do we need 3 providers to tests  a collection? I'm just thinking about 
tests run speed

- 03 - Trailing white space

- 05 - whitespace errors

- 06 - white space errors

- 09 - breaks tests

   factory :invalid_provider, :parent => :mock_provider do
     name { '' }
   end

should be defined after :mock_provider in the provider factory



More information about the aeolus-devel mailing list