-
Notifications
You must be signed in to change notification settings - Fork 37
Aurora Anderson Recipe Rex #44
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
base: master
Are you sure you want to change the base?
Conversation
… to test the stuff
API MuncherWhat We're Looking For
|
CheezItMan
left a comment
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 made one note on your controller testing, if you need me to look at more or other tests, just ping me back and I'll take a look.
|
|
||
| describe "#create" do | ||
|
|
||
| it "can create a search" 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.
For this test case the proc is preventing errors from occurring, because `post login_path, params: {user: users(:aurora)} is raising an error because it's unable to find the user, but the proc is containing it. So the next 2 lines of the test never get executed.
You're also including search terms, health and user as params, but the controller is checking session for them (not sure why).
The test should look like
it "can create a search" do
post login_path, params: {
provider: users(:aurora).provider,
uid: users(:aurora).uid
}
must_respond_with :redirect
proc {
post save_search_path, params: {
search: {
search_terms: "pink lady",
health: "vegetarian",
user_id: users(:aurora).id}
}
}.must_change 'Search.count', 1
must_respond_with :success
endAnd I think from looking at it that the controller should be using params to save the search, not session. I'm not sure why session is involved at all.
…s a before action
added link to heroku app
API Muncher
Congratulations! You're submitting your assignment!
Comprehension Questions
PLEASE HELP ME WITH THESE QUESTIONS!
THANK YOU!!