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

Dionisia - Edges - Munchies #46

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

Conversation

larachan15
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? I read the documentation, but mostly used Postman.
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)? The API Wrapper links the API provider endpoint and the controller. It is not a model or a controller so it located in the lib folder. If I needed to interact with more than one API, I would make as many wrappers as needed.
Describe your API wrapper, the methods you created in it, and why you decided to create those methods/how they were helpful I have three methods in my wrapper. The fist returns a list of recipes by the label. It returns an array of up to 300 recipes. The second method is to display a single recipe via the create recipe method, which is my third method. This method builds the recipe by extracting the information I want from the API and creating a hash.
What was an edge case or failure case test you wrote for your API Wrapper? What was a nominal case? I didn't really do any edge cases for this. Probably the closest one is that it returns an empty array when a query is unsuccessful. For nominal cases I tested that the wrapper can search for recipes and that it can retrieve one recipe.
How does VCR aid in testing an API? It will record the API data when you run the test. It aids in future testing because then you can reuse this recorded data instead of making costly hits to an API to test functionality.
What is the Heroku URL of your deployed application? https://munchies-app.herokuapp.com/

set up homepage, index and show pages
search box working on homepage
index page with link on label working. Show page is not
fixed controller, refactored some code in api_wrapper
@CheezItMan
Copy link

API Muncher

What We're Looking For

Feature Feedback
Core Requirements
Git hygiene Good number of commits and good commit messages
Comprehension questions Check
General
Rails fundamentals (RESTful routing, use of named paths) Check, well done
Semantic HTML Overall well done, just a note that you can use other container tags like section, article, etc with Bootstrap formatting classes. You don't have to use div.
Errors are reported to the user Missing, in addition an invalid recipe uri will cause the app to crash.
API Wrapper to handle the API requests Check
Controller testing Only nominal case testing. You should test edges and negative cases.
Lib testing Only nominal case testing. You should test edges and negative cases.
Search Functionality Check
List Functionality Check
Show individual item functionality Check
Styling
List view shows 10 items at a time and/or has pagination Check, but it could be styled better.
Attractive and usable UI Nice overall, I like the rollover effects with the images.
API Features
The App attributes Edamam Check
The VCR cassettes do not contain the API key Check
External Resources
Link to deployed app on Heroku Check
Overall Well done, you hit the majority of the learning goals. Areas to improve upon include testing edge-cases, and updating your wrapper to check to make sure that the response is successful.

end

describe "index" do
it "can get a list of recipes" do

Choose a reason for hiding this comment

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

You should also have a test a search result with nonsense like ^&* and "". In other words include negative cases.

end

describe "show" do
it "can get show page for a valid recipe uri" do

Choose a reason for hiding this comment

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

Similar to the above, you should test the controller with an invalid id.


it "returns empty list when query is unsuccessful" do
VCR.use_cassette("list_recipes") do
query = "waaaaaah"

Choose a reason for hiding this comment

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

I would also test it with an emptystring.

end

it "can retrieve one recipe" do
VCR.use_cassette("show_recipe_detail") do

Choose a reason for hiding this comment

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

Like the controller, you should also test with an invalid URI.

# binding.pry

# new_url = CGI.escape(url(id))
data = HTTParty.get(url).first

Choose a reason for hiding this comment

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

You should have some sort of if statement which checks to see if the request was successful.

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