[PATCH conductor 0/4 rev. 2] Provider Account API - show action

Richard Su rwsu at redhat.com
Tue Jul 24 00:52:50 UTC 2012


On 07/23/2012 07:10 AM, pblaho at redhat.com wrote:
> This is second revision of Provider Account API - show action.
>
> I added more tests for Credentials - based on FactoryGirl definitions
>
Hi Petr,

Thanks for adding the tests for credentials. This looks better.

After I had worked on the delete functionality. I noticed that the 
provider account api rspec tests are a bit difficult to follow. And in 
most cases are causing the test framework to do more work than is necessary.

In general we want to setup mock objects at the beginning, create the 
request, and assert the results have the expected values. The way you 
constructed the tests caused the before blocks to be called multiple 
times within the same test. You can see this by inserting a puts in one 
of the index before blocks. You can also see more operations being 
written out to $RAILS_ROOT/log/test.log than one would expect.

I refactored them and attached the patch to this email. Let me know what 
you think.

- Richard
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Refactor-provider-account-api-index-and-show-tests.patch
Type: text/x-patch
Size: 12110 bytes
Desc: not available
URL: <https://lists.fedorahosted.org/pipermail/aeolus-devel/attachments/20120723/45029e53/attachment.bin>


More information about the aeolus-devel mailing list