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

ampersands - Mariko #47

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

ampersands - Mariko #47

wants to merge 7 commits into from

Conversation

marikoja
Copy link

@marikoja marikoja commented May 9, 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? First I read the documentation from Edamam, then it was mostly trial and error using postman.
Describe your API Wrapper. How did you decide on the methods you created? My wrapper has two methods one lists all the recipe results up to 100 and the second shows an individual recipe from the list. Initially I struggled with understanding that you need to make two separate calls to the API.
Describe an edge case or failure case test you wrote for your API Wrapper. I use the edge case of not providing enough arguments to the wrapper. I could not figure out how to structure a test for a recipe with that does not exist or has a bad uri.
Explain how VCR aids in testing an API. VCR stores a call to the api in a yaml file. This reduces the number of calls that are necessary and allows you to test when you are offline.
What is the Heroku URL of your deployed application? https://muncher-munch.herokuapp.com/
Provide a link to the Trello board you used

@CheezItMan
Copy link

API Muncher

What We're Looking For

Feature Feedback
Core Requirements
Git hygiene As you noted, you forgot to commit enough.
Comprehension questions Check
General
Rails fundamentals (RESTful routing, use of named paths) Your route are not RESTful. Your search results should go to the /recipes path, and the individual show page, /recipes/:id
Semantic HTML Check
Errors are reported to the user The search results page does report errors, the show page just crashes if the API can't find the recipe URI.
API Wrapper to handle the API requests Check
Controller testing You've got some issues here, I left notes in your code, most seriously, you have direct calls to the wrapper in the controller test. See my notes and let me know if you have questions.
Lib testing Check
Search Functionality Check
List Functionality Check
Show individual item functionality (link to original recipe opens in new tab) It doesn't open in a new tab, but it works.
Styling
Responsive layout The layouts aren't responsive.
List View shows 10 items at a time/pagination Check
The app is styled to create an attractive user interface A good start, you obviously didn't have time to finish the styling. The pagination isn't centered, the layout isn't responsive, sometimes the text is hard to read etc.
API Features
The App attributes Edaman Check
The VCR casettes do not contain the API key Check
External Resources
Link to Trello Board MISSING
Link to deployed app on Heroku Check
Overall It's clear you struggled in this project, it's also clear you made great strides this week. The biggest thing to look at here is the controller testing. Check my inline notes and let me know where you have questions. I'm happy to walk through things with you.


response = HTTParty.get(encoded_uri)

if !response.nil?

Choose a reason for hiding this comment

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

To make the skipped test pass you need to check to see if response has any elements, so

if !response.nil? && response.length > 0

it "should get a list of recpies" do
VCR.use_cassette("muncher") do
get recipe_results_path
recipes = EdamamApiWrapper.list_recipes("Nooch")

Choose a reason for hiding this comment

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

Why are you mixing using the Wrapper in the controller test. In this file you should only be testing the controller.

Instead this test should look like:

    it "should get a list of recpies" do
      VCR.use_cassette("muncher") do
        get recipe_results_path, params: {q: "Nooch"}
      end
      must_respond_with :ok
    end

flash[:message] = "Sorry, We couldn't find any matching recipes"
redirect_to root_path
else
@results = Kaminari.paginate_array(EdamamApiWrapper.list_recipes(search_term)).page(params[:page]).per(10)

Choose a reason for hiding this comment

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

You have a test responding with :found instead of :ok, but your controller is only responding with :ok

it "redirects to root_path for empty search" do
VCR.use_cassette("muncher") do
get recipe_results_path
EdamamApiWrapper.list_recipes("")

Choose a reason for hiding this comment

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

Again, this shouldn't be in the test case, instead just have the get request

  get recipe_results_path, params: {q: ""}

end

describe "show" do
it "succeeds with for vaid recipe" do

Choose a reason for hiding this comment

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

You also need a negative case.

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