PWCkr lets you search for AND, wait for it, VIEW photos from flickr (the much celebrated and loved Yahoo! service)!
I'm glad you asked.
View a photo and then click on the tags and discover... more photos. Great.
At the last minute I decided to change the searching stratgey to :tags and tags_mode:'all' for more relevant results. Also my tests expect tags so ;-) No entirely convinced about this...
allow(ANY_CLASS).to receive(:get_todays_quote){"fuck yeah"}
PWCkr only has one Model, Photo, which implements the Flickr API. The model test talks to the real API to make sure we're parsing the api responses correctly.
The model completely wraps the api so that no other code touches the api.
The feature tests test the overall app behaviour and the app UI using a Flickr API mock class (since the real api is tested in our model test)
The Flickr API is quite chatty. To avoid "locking the UI thread" most chatty calls are made asycnhrounously.
A compromise of delivery time (shipping this) and peformance (there's no caching stragegies nor a complete hand over to the client side) is to control the batch size of each call. This makes it easy to quickly tweak the batch size of each call together with the overal page size of each "page" to get a feel of peformance.
(check out line 29: https://github.com/thatandyrose/pwckr/blob/master/app/assets/javascripts/photos.js#L29)
- PWCkr runs on rails 3 and ruby (tuesday) 2
- PWCkr tests use rspec + capybara with :selenium for the js:true tests.
- No database is used (though postgres is configured).
- Bootsrap 3, although layout is keep to ultra simple so not mnay boostrap "features" are used.
$ git clone git@github.com:thatandyrose/pwckr.git $ cd pwckr $ bundle install $ rails s
You'll need firefox to run the tests. The FlickrAPI credentials are hardcoded (#TODO move them into application.yml)