which in this case actually breaks the test. Adding it back in ensures that it works properly. Here's the full test:
it 'does not let user view login page if already logged in' do
user = User.create(:username => "becky567", :email => "starz@aol.com", :password => "kittens")
params = {
:username => "becky567",
:password => "kittens"
}
post '/login', params
get '/login'
expect(last_response.location).to include("/tweets")
end
I've submitted a PR to master to add back in the creation of a user before the attempted login. I've also added a PR to solution to remove some of the extra session[:user_id] = user.id stuff that isn't actually doing anything. (Because the app doesn't have access to the session hash created within the test)
@DanielSeehausen Had a couple of students bring this one up today. For whatever reason, the commit I added before removes the first line here:
user = User.create(:username => "becky567", :email => "starz@aol.com", :password => "kittens")
which in this case actually breaks the test. Adding it back in ensures that it works properly. Here's the full test:
I've submitted a PR to master to add back in the creation of a user before the attempted login. I've also added a PR to solution to remove some of the extra
session[:user_id] = user.id
stuff that isn't actually doing anything. (Because the app doesn't have access to the session hash created within the test)Sorry for the trouble!