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

Leticia - API Muncher - Ampers #27

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

Conversation

LetiTran
Copy link

@LetiTran LetiTran commented May 7, 2018

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 took a while to read the Edamam API docs and then explore it with Postman to see the possible responses I would get and understand how to handle the information that I was given.
Describe your API Wrapper. How did you decide on the methods you created? I wrote two methods, the first one (#find_recipes) for consuming the JSON given from the API and storing new Recipes objects created with it in an array. The second one (#find) uses the Recipe.id and formats it into the API id for each recipe and makes a new request to the API in order to get all the detailed information necessary of the specific recipe to display on #show by creating a new Recipe object again.
Describe an edge case or failure case test you wrote for your API Wrapper. If given a bogus recipe id, it should return nil.
Explain how VCR aids in testing an API. VCR records and then simulates a API response in order to reduce the dependency of the API (in case they are down or something like that) and also allows us to test as many times needed without actually making calls to API's and ending up using all of the requests available for our app (per times or cost).
What is the Heroku URL of your deployed application? leti-muncher
Provide a link to the Trello board you used https://trello.com/invite/b/nbwZacs9/1d7299a0ede77fbb5f47b27c6aa2e52c/api-muncher

LetiTran added 30 commits May 2, 2018 13:57
…api_wrapper (only happens if using #find method)
…box on the right using form_tag for the recipes controller
@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 some unnecessary html and div elements.
Errors are reported to the user Error messages both for empty search results & erroneous URIs on the show action
API Wrapper to handle the API requests Check
Controller testing Check, see my notes on the search action. You're also missing a test for the homepage.
Lib testing Check
Search Functionality Check
List Functionality Check
Show individual item functionality (link to original recipe opens in new tab) Check
Styling
Responsive layout Check, both on show and search results
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 Check
The VCR cassettes do not contain the API key ERROR See my notes in test_helper.rb
External Resources
Link to Trello Board Check
Link to deployed app on Heroku Check
Overall You did well and hit all the learning goals. You do need to check my notes on your tests as you have some issues there. Overall however you did well. Nice work!

<header>
<!-- Menu for searching available in every page: -->

<div class="title-bar" data-responsive-toggle="responsive-menu" data-hide-for="medium">

Choose a reason for hiding this comment

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

This doesn't seem to do anything.

describe RecipesController do

describe 'index' do
it "Should get a list of Recipes when give a term" do

Choose a reason for hiding this comment

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

What about when Query is empty or missing, or not a valid search term?

VCR.use_cassette("recipes") do
response = EdamamApiWrapper.find_recipes("chicken")

response[0].must_be_kind_of Recipe

Choose a reason for hiding this comment

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

You should loop through the array and verify that all elements are instances of Recipe.

:match_requests_on => [:method, :uri, :body] # The http method, URI and body of a request all need to match
}
# Don't leave our Slack token lying around in a cassette file.
config.filter_sensitive_data("<SLACK_TOKEN>") do

Choose a reason for hiding this comment

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

Gah you're filtering the Slack token and not the Edaman token!

doh!

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