Don't use assigns(:current_user) in spec

openid
Micha Wrobel 13 years ago
parent 96fee0c6da
commit 2669bbb310

@ -6,8 +6,6 @@ class ApplicationController < ActionController::Base
helper_method :current_user
private
def current_user
@current_user ||= User.first(:id => session[:user_id]) if session[:user_id]
end

@ -23,7 +23,7 @@ describe SessionsController do
it "should create session" do
session[:user_id].should_not be_nil
assigns[:current_user].should_not be_nil
@controller.current_user.should_not be_nil
end
it "should redirects user to root url" do
@ -62,7 +62,7 @@ describe SessionsController do
it "should destroy session" do
session[:user_id].should be_nil
assigns[:current_user].should be_nil
@controller.current_user.should be_nil
end
it "should redirects to root_url" do

Loading…
Cancel
Save