-
Notifications
You must be signed in to change notification settings - Fork 42
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
Kayla Ecker - Caret #36
base: master
Are you sure you want to change the base?
Conversation
API MuncherWhat We're Looking For
|
url = BASE_URL + "q=" + query + ID_AND_KEY + "&to=50" | ||
data = HTTParty.get(url) | ||
recipes = [] | ||
unless data["hits"].empty? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should have this check read
unless data["hits"].nil? || data["hits"].empty?
<%= flash[:message] %> | ||
</h3> | ||
<%end%> | ||
</div> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to fix alignment a bit, plus unnecessary div
elements.
<div class=name> | ||
<%= link_to recipe.name, recipe_path(recipe.name, recipe_id: recipe.id)%> | ||
</div> | ||
<img src="<%= recipe.image %>", alt="<%= recipe.name %>"/> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
making the image a link would be good as well.
data = HTTParty.get(url) | ||
recipe = "" | ||
unless data.empty? | ||
recipe = self.create_recipe(data[0]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should also check to see if data[0] has values
it "succeeds when there are recipes for search" do | ||
query = "apple" | ||
VCR.use_cassette("search") do | ||
EdamamApiWrapper.search(query).empty?.must_equal false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is too specific to the wrapper. Let the controller make the wrapper call, focus on using the controller.
must_respond_with :success | ||
end | ||
end | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about show recipe tests?
API Muncher
Congratulations! You're submitting your assignment!
Comprehension Questions