Major update of Selectricity to work with Rails 2.2.2 from 1.2! This included a large number of changes: - removal of randarray.rb (features are not in the new version or ruby) - removal of sparklines plugin and replacement with gemified version of sparklines and sparklines_generator - addition of act_as_list plugin which is no longer in rails - disabling of all API code because action_web_service is deprecated in favor of active_resource (!!!!) - large number of miscellaneous updates to do the new rails 2ish I've commented out the new features in the views (i.e., embedded) as this is going to replace the LIVE version of Selectricity. We should then test this well, slowly enable the new features, and get the tests i old_api_code back work with an active_resource interface.
Rename Selectricity API calls to more explicitly call itself quickvotes.
Finished writing the selectricityservice_test unit tests which end up testing much of the application.
Big commit includes: * A bunch of cleanup of the unit tests. * Addition of fixtures for elections and candidates. * Cleanup of the selectricitservice model. * Additional tweaks for testing including addition of ruby-debug for testing.
Cleaned up some of the test cases.
Add several testcases for casting quickvotes with invalid information
* Add a few testcases for checking for nonexistent things * Change helpers to be a bit more streamlined in the way they handle assertions failures vs unexpected exceptions.
Add assert_cast_quickvote_succeeds/fails helper, and changed the fails helpers to instead check that the _succeeds helper doesn't really succeed.
Add testcase for checking validity of vote results
* Refactor checking proper quickvote creation to helper assert_create_quickvote_succeeds * Remove a crufty assertion from XML checker -- it is redundant * Add testcase for a description with binary characters
* Add one more assertion in testcase for dupe candidates * Remove test_create_quickvote_description_htmlescape. As I thought earlier, I actually want the DB to properly store HTML elements. It's the job of the view to make sure it doesn't clobber itself displaying the element. - Change the test instead to a test for proper XML escaping. An appended </string> element should be stored properly and not trip hell
Correct a bunch of the testcases. Poor copy-and-paste led to description => nil where it shouldn't have been. Now a bunch more testcases FAIL. Yay me.
* Refactor testcase code -- create_quickvote_fails assertion -- was using same block of code repetivitely Add more testcases for improper data * Passing in a nil ElectionStruct to quickvotes * Passing in only nil {name, description, candidates} * Passing in whitespace for name, description, candidates * Passing in duplicate candidates * Passing in dirty HTML in description field - IMO this may not be a "bug" -- we should rather assert that the view will not be injected with HTML. It may be desirable (a feature) to store HTML-ish text in the database.
Added more testcases: * Cast large # of votes * Create large # of quickvotes * Test creation of quickvote with a bad name
Add some testcases: * Create a new quickvote * Retrieve a quickvote * Casting a quickvote
Started implementing XMLRPC test cases