ApplicationController:
class ApplicationController < ActionController::Base
before_filter :authenticate_user!
protect_from_forgery
end
DashboardsController:
class DashboardsController < ApplicationController
def index
end
end
DashboardsControllerSpec:
require 'spec_helper'
describe DashboardsController do
include Devise::TestHelpers
describe "GET 'index'" do
it "returns http success" do
get 'index'
response.should be_success
end
end
end
Result:
Failure/Error: get 'index'
NoMethodError:
undefined method `authenticate_user!' for #<DashboardsController:0x007fef81f2efb8>
Rails version: 3.1.3
Rspec version: 2.8.0
Devise version: 1.5.3
Note: I also created support/deviser.rb file but that does not help. Any ideas?