everydayrails/rails-4-1-rspec-3-0

Question on controller testing advanced..authentication comment out...

eaglerockdude opened this issue · 1 comments

Question: I am on controller spec testing advanced. I noticed from a chapter before I had commented out the "before_action: authenticate"

But whenthat I put it back in, my specs up to chapter 6 are still passing...I am trying to understand why.. Shouldn't they be failing.

From chapter 5

F_or this exercise, we need to make a slight modification to our application’s
contacts_controller.rb file. In order to focus on the basics of controller testing,
let’s bypass the application’s authentication layer for the duration of the chapter.
The quickest way to do that is to comment it out:
app/controllers/contacts_controller.rb
1 class ContactsController < ApplicationController
2 # before_action :authenticate, except: [:index, :show]
3 before_action :set_contact, only: [:show, :edit, :update, :destroy]
4_
5 # etc.

Nevermind found it. My new :user factory from chapter 6 was kicking in...if i commented it out I get failures.