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

Ungco-Muncher #26

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

Ungco-Muncher #26

wants to merge 10 commits into from

Conversation

amandaungco
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? Read the documentation and used Postman and 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)? An Api wrapper helps protect your code from changes in an api.
Describe your API wrapper, the methods you created in it, and why you decided to create those methods/how they were helpful I am using my api wrapper to obtain data from the Edamam API and format it in a way my program can use. I create instances of recipe so I can callupon the different functions later.
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? VCR helps test an API by saving the http interactions between the app and the API. This helps reduce the number of requests made to the API during testing.
What is the Heroku URL of your deployed application? https://ungcomuncher.herokuapp.com/

@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 Check, but you didn't list edge or nominal test cases
General
Rails fundamentals (RESTful routing, use of named paths) The recipes#show action isn't a RESTful route.
Semantic HTML Pretty good semantic HTML, but you've got some broken html
Errors are reported to the user Check for search results, but the show action crashes when an invalid id is served
API Wrapper to handle the API requests
Controller testing One test, it doesn't work, see my notes. You also need to test the index method with an invalid search term, a valid one, and positive and negative tests for the show action.
Lib testing Overall pretty good
Search Functionality
List Functionality Check
Show individual item functionality Check
Styling
List view shows 10 items at a time and/or has pagination Yes, but unstyled
Attractive and usable UI Minimal styling, not a big deal.
API Features
The App attributes Edamam
The VCR cassettes do not contain the API key Check
External Resources
Link to deployed app on Heroku Check
Overall Ok, but you didn't really do the controller testing. That's something to work on. Let me know if you have questions about how the controller testing should work.

<% end%>
<%= yield %>
</body>
<div id="edamam-badge" data-color="white"></div>

Choose a reason for hiding this comment

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

Broken HTML, this div should be inside the body.

<h3> Dietary Labels</h3>
<ul>
<%@recipe.dietaryinformation.each do |diet|%>
<li> <%=diet%></li>

Choose a reason for hiding this comment

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

The ul is unclosed.

search_term = "chicken"
response = EdamamApiWrapper.list_recipes(search_term)
get recipes_index_path
binding.pry

Choose a reason for hiding this comment

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

You left a binding.pry in your submission.

it "should get index" do
VCR.use_cassette("recipes") do
search_term = "chicken"
response = EdamamApiWrapper.list_recipes(search_term)

Choose a reason for hiding this comment

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

This is a controller test and yet you are testing the wrapper!

You're also not passing in the search term with the get request.

end
end

it "returns an empty array for an invalid URI" do

Choose a reason for hiding this comment

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

I would suggest returning nil if the API returns nothing instead of an array, as this method isn't supposed to return a collection of recipes.

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.

2 participants