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

Lauren Cardella -- Carets #29

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

Conversation

enigmagnetic
Copy link

API Muncher

Congratulations! You're submitting your assignment!

Comprehension Questions

Question Answer
How did you go about exploring the Edamam API, how did you try querying the API? I read the documentation, then tried two different queries in Postman, one using the q key (for a recipe search by keyword) and one using the r key (to return a recipe by ID).
Describe your API Wrapper. How did you decide on the methods you created? I created two methods for my API Wrapper, one to return a list of search results (used in the recipes controller index action) and the other to return a particular recipe (used in the recipes controller show action).
Describe an edge case or failure case test you wrote for your API Wrapper. I wrote an edge case test for both API Wrapper methods to make sure that an invalid argument returns an empty array.
Explain how VCR aids in testing an API. VCR records the API responses for a given call so that it can be used in subsequent matching calls. This helps reduce the number of calls made to the API (so that the tests don't contribute to any limits), speeds the tests up because new calls are not needed for each test, and it allows for testing even when the API service is down.
What is the Heroku URL of your deployed application? https://muncher-ada.herokuapp.com/

…ex. Edit application and recipe index views. Search not returning any results.
…index view. Build show action in recipes controller. Add uri instance variable to recipe.rb and make some info into optional variables.
…use array data. Change index action to include paginate method. Add pagination to recipes index view.
@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
Semantic HTML Check, although your index page has a div that could be something else
Errors are reported to the user No search results reported for invalid searches. It crashes for invalid URIs for individual recipes
API Wrapper to handle the API requests Check, although you need to work on error handling
Controller testing 2 failing tests
Lib testing Check, but a failing test due to lack of error handling in your wrapper
Search Functionality Check
List Functionality Check
Show individual item functionality (link to original recipe opens in new tab) Check
Styling
Foundation Styling for responsive layout Well done
List View shows 10 items at a time/pagination Check
The app is styled to create an attractive user interface Check
API Features
The App attributes Edaman Yes, but no link.
The VCR casettes do not contain the API key Check
External Resources
Link to deployed app on Heroku Doesn't work!
Overall Your Heroku isn't working and you have trouble with negative case tests as well as some error handling in your wrapper. Not bad, but could be better.


data = HTTParty.get(url)

unless data.empty?

Choose a reason for hiding this comment

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

I would add a rescue because for bad requests data is coming back as [ which won't parse correctly.

<% else %>
<% @recipes.each do |recipe| %>
<article class="recipe">
<%= image_tag (recipe.image) %>

Choose a reason for hiding this comment

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

I would make the images for the results links as it's natural to want to click on'em.

it "can get a list of recipe search results" do
VCR.use_cassette("index_action") do
get recipes_path
must_respond_with :success

Choose a reason for hiding this comment

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

If there's not a search here it redirects back to home.

describe "show" do
it "can get a specific recipe" do
VCR.use_cassette("show_action") do
get recipe_path

Choose a reason for hiding this comment

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

There's no recipe to show, so it redirects to the homepage, at least I'd hope so, or prints an error message.

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