bikeindex/bike_index — pull request #57 by adherr (2014-08-21 18:41:30+00:00)
Title: wrote some tests for posting recoveries to the recovery app

There are some tests. If you want me to update the recovery app to respond with more information (like a URL of a tweet and facebook post if they're created) I can do that. Otherwise I think this works. I had some trouble in the spec at https://github.com/adherr/bike_index/blob/a2bf1708bf737f9b1b1899d39f346670d6ba9c55/spec/workers/recovery_notify_worker_spec.rb#L20 because the local variable in the spec was not re-querying after the update to do the test. Is this normal? How do you usually deal with this?

I also created a :stolen_bike factory that correctly creates and associates current_stolen_record (please take a look at that to be sure it's sane).

Fixed two little bugs in the worker to make the tests pass (using the default .env.development, so not pushing to the real recovery app. I looked at the JSON it sends and it looks good).

And, as usual, my emacs deletes whitespace at the end of lines and adds newlines at the end of files.