digitalprog / ruby_provisioning_api

a ruby wrapper for google apps provisioning api
http://digitalprog.github.com/ruby_provisioning_api
MIT License
2 stars 2 forks source link

Group spec #27

Open dbraga opened 12 years ago

dbraga commented 12 years ago

A lot of code replication (but seems to me its necessary because it's xml response/requests) Needs reviewal from your point of view

davide-targa commented 12 years ago

work in progress...

dbraga commented 12 years ago

I took a quick look. Let's take the save as an example:

After the normal save on spec you add (way to go!) : it "should return false if you try to save an invalid Group" do.

My concern is that we don't have a valid way to test random failures from google api. One example could be when you try to save a group that already exists on google groups. How do we fake that? We use our stub that mimicry the right response but we don't do the same for failures.

Another problem is to subsequential operations like update. we could test if we really updated the group or the user except we can't because our "find" stub is engineered to response always the same right thing

dbraga commented 12 years ago

Last commit regards #26 not #27 . my bad

davide-targa commented 12 years ago

Finally I can confirm that we have a way to test all the behaviors of all the methods. Thank you VCR Have a look at specs/user_specs.rb only 350-400 LOC to test ALL the User class! Pretty impressive! :+1: