-
Notifications
You must be signed in to change notification settings - Fork 45
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
Mary Ampers #41
base: master
Are you sure you want to change the base?
Mary Ampers #41
Conversation
it "succeeds with new valid username and redirects to root path" do | ||
#not sure why these tests don't work! | ||
new_user = User.new( | ||
provider: 'githib', |
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.
provider githib
???
Maybe this is the reason the test fails!
}.must_change 'User.count', 0 | ||
|
||
|
||
must_respond_with :bad_request |
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.
Your controller is redirecting instead of providing bad request.
perform_login(existing_user) | ||
post upvote_path(Work.find(works(:movie).id)) | ||
must_respond_with :redirect | ||
must_redirect_to work_path(Work.find(works(:movie).id)) | ||
end | ||
|
||
it "redirects to the work page after the user has logged out" 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.
This doesn't really go here.
end | ||
end | ||
|
||
describe "upvote" do | ||
|
||
it "redirects to the work page if no user is logged in" do | ||
existing_user = users(:dan) |
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.
A flash notice check would also be appropriate in cases like this.
|
||
perform_login(existing_user) | ||
|
||
post login_path, params: { |
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 is this doing? It's a failed login without enough data.
@@ -1,5 +1,33 @@ | |||
require 'test_helper' | |||
|
|||
describe UsersController do | |||
describe "index" 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.
What about tests for guest users?
MediaRanker RevistedWhat We're Looking For
|
No description provided.