-
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
Christina MedRanRev #38
base: master
Are you sure you want to change the base?
Conversation
MediaRanker RevistedWhat We're Looking For
|
@@ -1,34 +1,59 @@ | |||
class SessionsController < ApplicationController | |||
def login_form | |||
end | |||
def create |
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 don't seem to be setting session[:user_id] = user.id
here?
|
||
end | ||
expect{ | ||
post upvote_path(id)}.wont_change 'Vote.count' |
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.
Indentation is a little off here.
|
||
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.
empty test
|
||
it "redirects to the work page if the user has already voted for that work" do | ||
it "succeeds for a logged-in user and a fresh user-vote pair" 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.
There's no logging in here.
@@ -1,5 +1,40 @@ | |||
require "test_helper" | |||
|
|||
describe SessionsController do | |||
def create |
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.
Why do you have methods here? This is the test file. You should have it
blocks and expectations.
I do not understand what's going on here.
end | ||
|
||
it "redirects to the work page if the user has already voted for that work" do | ||
user = users(:grace) |
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 is a pretty good attempt at trying to test the login functionality along with voting.
Problems: 1. Your sessions controller isn't setting sessions[:user_id]
2. Somehow the post upvote_path(id)
is clearing session completely erasing everything in it. I'm not sure how.
All tests are passing but I haven't run simplecov yet. I don't think the user is being logged in. Will keep working at it to find it.