-
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
Dionisia - Edges - Munchies #46
base: master
Are you sure you want to change the base?
Conversation
set up homepage, index and show pages
search box working on homepage
index page with link on label working. Show page is not
show is still not working
fixed controller, refactored some code in api_wrapper
fixed error in routes
Dionisia work
Dionisia work
show page finally done
tests done, all passing
API MuncherWhat We're Looking For
|
end | ||
|
||
describe "index" do | ||
it "can get a list of recipes" do |
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 have a test a search result with nonsense like ^&*
and "". In other words include negative cases.
end | ||
|
||
describe "show" do | ||
it "can get show page for a valid recipe uri" do |
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.
Similar to the above, you should test the controller with an invalid id
.
|
||
it "returns empty list when query is unsuccessful" do | ||
VCR.use_cassette("list_recipes") do | ||
query = "waaaaaah" |
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.
I would also test it with an emptystring.
end | ||
|
||
it "can retrieve one recipe" do | ||
VCR.use_cassette("show_recipe_detail") do |
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.
Like the controller, you should also test with an invalid URI.
# binding.pry | ||
|
||
# new_url = CGI.escape(url(id)) | ||
data = HTTParty.get(url).first |
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 some sort of if
statement which checks to see if the request was successful.
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)?