Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

goeun / edges / api muncher #40

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open

Conversation

goeunpark
Copy link

API Muncher

Congratulations! You're submitting your assignment!

Comprehension Questions

Question Answer
How did you go about exploring the Edamam API, and how did you try querying the API? used postman, messed around with data structures in pry
What is an API Wrapper? Why is it in lib? How would your project change if you needed to interact with more than one API (aka more than just the Edamam API)?
Describe your API wrapper, the methods you created in it, and why you decided to create those methods/how they were helpful
What was an edge case or failure case test you wrote for your API Wrapper? What was a nominal case?
How does VCR aid in testing an API?
What is the Heroku URL of your deployed application? https://goeun-muncher.herokuapp.com/

Copy link

@droberts-sea droberts-sea left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We talked about this in our 1-on-1 today. Full review to come later in the week, once you've gotten a chance to update this.

def self.find_recipe(params)
@recipe_list.each do |recipe|
if recipe.name == params
return recipe

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This only works if the recipe being shown is in the most recent search results. If you open up two browser tabs and search for different things, you can only click on results from the last search.

The right thing to do here would be to send another request to Edamam, to get the details for that recipe. To do so you probably need something more distinct than just the recipe name - the URI might work nicely.

In general you should avoid using instance variables in class methods - these are basically global variables, and should only be used in very specific circumstances.


root 'recipes#search'
get 'index', to: 'recipes#index', as: 'recipes_index'
get ':recipe/show', to: 'recipes#show', as: 'recipes_show'

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These paths aren't quit RESTful. Why not use resources [:index, :show] here?

<% end %>
<% end %>
</ul>
</class>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is this </class> tag?

@CheezItMan
Copy link

API Muncher

What We're Looking For

Feature Feedback
Core Requirements
Git hygiene Not very many commits, but good commit messages
Comprehension questions You only answered the Heroku link, and how you explored the API.
General
Rails fundamentals (RESTful routing, use of named paths) Check
Semantic HTML Overall pretty good, but just a note that you can use other container tags like section, main, article etc with Bootstrap styling class names. You don't have to always use div.
Errors are reported to the user An invalid recipe name will result in the app crashing.
API Wrapper to handle the API requests Check, but see Dan's note on the find_recipe method. The way you have it won't work with two browser tabs, or if the user bookmarks a specific recipe. Instead you should make another API call with the recipe's uri field.
Controller testing Missing
Lib testing MISSING
Search Functionality Check
List Functionality Check
Show individual item functionality Check, but it won't always work.
Styling
List view shows 10 items at a time and/or has pagination No Pagination
Attractive and usable UI Simple, but nice looking, good responsiveness
API Features
The App attributes Edamam Check
The VCR cassettes do not contain the API key NO TESTING
External Resources
Link to deployed app on Heroku Check
Overall Well you got the API to work, but you didn't test anything. Clearly one thing to review is how to test an app that uses an API and how to use VCR in testing. See my and Dan's comments.

<% @recipes.each do |recipe| %>
<li class="recipe_card">
<div class="name"><h2><%= recipe.name %></h2></div>
<img src=<%= recipe.image %> class="thumbnail_photo">

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion: Use image_tag and make the image a hyperlink. It's human nature to want to click on the link.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants