-
Notifications
You must be signed in to change notification settings - Fork 47
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
Katricia - Edges - API Muncher #42
base: master
Are you sure you want to change the base?
Conversation
…pe path on index page
…hange url for show_details from search url to show url
API MuncherWhat We're Looking For
|
# get 'recipes/index', to: 'recipes#index', as: 'index' | ||
# get 'recipe', to: 'recipes#show', as: 'show' | ||
|
||
resources :recipes |
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.
Do you need all 7 RESTful routes here?
# without [0] gave "no implicit conversion of string into integar" error. why need index if only one? | ||
return recipe | ||
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.
This will return nil
if the API didn't send back a result, but your controller isn't set up to handle this case.
|
||
it "can get list of recipes for user search term" do | ||
VCR.use_cassette('recipes') do | ||
get recipes_path, params: { q: 'lemongrass'} |
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 if the search yields no results?
You should also be testing the show
action here (success and failure cases)
describe "find details" do | ||
it "can get the details of a single recipe" do | ||
VCR.use_cassette("recipes") do | ||
query = "ginger" |
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.
These are a good start, but you should have a failure case for both methods.
API Muncher
Congratulations! You're submitting your assignment!
Comprehension Questions
lib
? How would your project change if you needed to interact with more than one API (aka more than just the Edamam API)?