Conversation
There was a problem hiding this comment.
Here you are rescuing the entire search_by_title method, where no matter what exception is raised, you're showing "no_movie_found". That's not REALLY the case though. For example, if the API is down or broken, you still want people to be able to find their "Caddyshack"
|
This looks good! I added a comment on having rescues that reach a little too far. Let me know if that makes sense or if we should go into further detail. |
|
I understand what you are saying. Would you mind taking a look at Thanks, On Mon, Mar 11, 2013 at 2:46 PM, Jesse Wolgamott
|
|
The 6th spec is in the spec/movie_spec.rb. If you ran it separately you'd get what you expect. $ rspec spec/api_spec.rb
.....
Finished in 0.0053 seconds
5 examples, 0 failuresI'll leave a couple comments on the spec file too :) |
There was a problem hiding this comment.
I would not add the expect here in the before block. The before block is adding this test to every example.
I do think having this in the before makes sense, because you want every time it executes get_url_as_json it should return that fixture.
Api.stub(:get_url_as_json) { JSON.parse(File.read("spec/fixtures/forrest.json"))
I'm pretty sure that lib\api.rb & movie_json.rb are correct. I had a lot of trouble with spec\api_spec.rb. When I run the spec, it says "6 examples 0 failures", but there are only 5 "it"s. Will appreciate any comments/suggestions. Thanks.