Open
Conversation
…ng too many at once
API MuncherWhat We're Looking For
|
dHelmgren
reviewed
Nov 15, 2018
| get "/auth/:provider/callback", to: "sessions#create", as: 'auth_callback' | ||
| delete "/logout", to: "sessions#destroy", as: "logout" | ||
|
|
||
| resources :recipe_searches, only: [:index, :show] |
There was a problem hiding this comment.
Nice work setting these with resources
| attr_reader :label, :recipe_uri, :source, :source_uri, :ingredient_lines, | ||
| :image_uri, :recipe_yield, :total_time, :health_labels | ||
|
|
||
| REQUIRED_ARGS = [:label, :recipe_uri, :source, :source_uri, :ingredient_lines] |
There was a problem hiding this comment.
I would say you're over-validating here. In general, you should only validate fields that will cause your app to break if they're not there. In this case, that's label, uri and possibly image. Anything beyond that is an unnecessary dependency on the data coming from the API and is an extra thing for you to test.
| recorded_at: Wed, 31 Oct 2018 22:22:23 GMT | ||
| - request: | ||
| method: get | ||
| uri: https://api.edamam.com/search?app_id=<EDAMAM_APP_ID>&app_key=<EDAMAM_APP_KEY>&r=http://www.edamam.com/ontologies/edamam.owl%23bogus! |
|
|
||
| describe FavoritesController do | ||
| it "should get index" do | ||
| get favorites_path |
There was a problem hiding this comment.
There are some interesting cases you're not covering here:
- What happens if no search term is provided?
- What if the search returns no results?
It might also be worthwhile to add some tests around the paging parameters:
- What happens if they're absent?
- Do you get different results when they change?
- What if you send a bogus value, like a negative page number?
Just FYI, Your pagination breaks if I give it a negative page.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
API Muncher
Congratulations! You're submitting your assignment!
Comprehension Questions
lib? How would your project change if you needed to interact with more than one API (aka more than just the Edamam API)?Trello: https://trello.com/b/HL0gtltd/sj-api-muncher
See Trello for what remains to be done. I'm not finished with testing, but a lot of what's left is testing that I've practiced with MR-R and bEtsy. While TDD is a good practice, for this project I decided to prioritize learning new skills, like OAuth Google and filtering search results.