I have a small ruby app with one model, the model uses ActiveRecord & the find_by_sql method as the query is a little complex, it loops over the results and produces a CSV file, this file is then uploaded to a remote FTP server.
Just wondering what are the RSpec tests that I should consider writing for t开发者_如何学Gohis non-rails app?
First time writing non-rails tests and have been hit with "testers block" :-)
Thanks!
Here's a list of things I would likely test for.
- Test that the application can connect to the FTP server and upload a trivial file.
- Test the query with various points of data.
- Test the CSV generation with irregular data (a forgotten field and other PEBCAK errors)
- Test that the CSV file contains all data.
- Test that the application responds gracefully (or as intended) in the event of a failure.
Posting any code or the query itself would allow us to offer much better advice.
精彩评论