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

Carets- Julia Meier- API Muncher #25

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

Conversation

julmeier
Copy link

@julmeier julmeier commented Nov 6, 2017

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 experimented with Postman to query the API. It also helped to read through the documentation. Once creating my api_wrapper class and recipe class, I experimented some more on how to best query the API.
Describe your API Wrapper. How did you decide on the methods you created? The API Wrapper class has methods that constructs the API url needed to return either a collection of recipes or a single recipe, and corresponding methods to create ruby objects from the received API recipe data. I also have a method that just returns the number of recipes in the Edamam API for a give keyword search.
Describe an edge case or failure case test you wrote for your API Wrapper. One test makes sure that a bogus request (ex. "jklmnopqrstuv" in the search bar) will return an empty array.
Explain how VCR aids in testing an API. A VCR records an application's interaction with an HTTP request. It is helpful in testing APIs because the interaction can be called and recorded only once. Tests can use this recording without making more calls to the API. This is helpful if there is a limit on the number of API calls (for example, Edamam only allows 5 per minute, which would make controller testing difficult) or the API calls are expensive. It also allows programmers to test offline.
What is the Heroku URL of your deployed application? http://hidden-woodland-83927.herokuapp.com/

…ith how to inject the from/to into the params
…ut to start writing tests on the edamam_api to see why it's returning an empty array for the list_recipes method
…nly gives 100 recipes at a time. Also made show controller
…he number_of_recipes is <10, 10-100, or greater than 100
…ause heroku believes the @number_of_recipes is nil
…dded two lines to production.rb per stackoverflow heros
… a large white gap between the image and the footer
@CheezItMan
Copy link

API Muncher

What We're Looking For

Feature Feedback
Core Requirements
Git hygiene Lots of commits, good mesages
Comprehension questions Check
General
Rails fundamentals (RESTful routing, use of named paths)
Semantic HTML Reasonable semantic HTML, you do have some div elements which are there for styling, that could be replaced or dropped and the semantic tags used instead..
Errors are reported to the user Flash notices if they didn't search for anything.
API Wrapper to handle the API requests Check
Controller testing Tests written, but not working, You did have the postgres problem earlier.
Lib testing Check
Search Functionality Work great!
List Functionality Well done!
Show individual item functionality (link to original recipe opens in new tab) This is missing.
Styling
Foundation Styling for responsive layout Check
List View shows 10 items at a time/pagination Well done
The app is styled to create an attractive user interface Nicely styled
API Features
The App attributes Edaman Check
The VCR casettes do not contain the API key Check
External Resources
Link to Trello Board NA
Link to deployed app on Heroku Well done
Overall Nicely done, you recovered well from the Postgres problem after I showed you how to fix it. Pretty good testing and nice styling. Well done.

end
end

describe "search by page (i.e. pagination)" do

Choose a reason for hiding this comment

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

Good sets of tests.

it "redirects to the home page if the user enters nothing as a keyword" do
get recipes_search_path params:{keywords: ""}
must_redirect_to root_path
flash[:failure].must_equal "You did not enter any keywords. Please enter ingredient keywords into the search bar."

Choose a reason for hiding this comment

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

Your controller doesn't actually add that flash message.

#binding.pry
@keywords = params['keywords']
if @keywords.blank?
redirect_to root_path

Choose a reason for hiding this comment

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

no flash notice?

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