-
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
Laura #30
base: master
Are you sure you want to change the base?
Laura #30
Conversation
… I can see an error message detailing what the problem is and what I should do
API MuncherWhat We're Looking For
|
Rails.application.routes.draw do | ||
root 'recipes#home' | ||
get 'index', to: 'recipes#index', as: 'recipes_index' | ||
get ':uri/show', to: 'recipes#show', as: 'recipes_show' |
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.
Not sure why :uri
is before show here. Could you use resources
for the index and show pages?
return CGI.escape(r) | ||
end | ||
|
||
def self.find_recipe(uri) |
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.
nice work finding a way to keep this method DRY
test "should get index" do | ||
get recepies_index_url | ||
assert_response :success | ||
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 test doesn't cover all your cases.
- What happens if no search term is provided?
- What if the search returns no results?
It might also be worthwhile to add some tests around the paging parameters:
- What happens if they're absent?
- Do you get different results when they change?
- What if you send a bogus value, like a negative page number?
<%= javascript_include_tag 'application', 'data-turbolinks-track': 'reload' %> | ||
</head> | ||
|
||
<body> |
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 probably have a header that can take the user back to the main page.
<div class="card" style="width: 18rem;"> | ||
<img class="card-img-top" src="<%=recipe.image_url%>" alt="Card image cap"> | ||
<div class="card-body"> | ||
<h5 class="card-title"<%=recipe.label%></h5> |
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.
Can't see this text on my screen.
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)?