Displaying 1 result from an estimated 1 matches for "find_by_id_and_rol".
Did you mean:
find_by_id_and_role
2009 Oct 19
0
Help with controllers specs
...##
before(:each) do
login_as_user
@user = mock_model(User)
User.stub!(:find).and_return(@user)
end
##############################################################
it "should find user and return object" do
User.should_receive(:find_by_id_and_role).with(1,
"SJ").and_return(@user)
get :edit, :id => 1, :role => ''SJ''
end
end
end
**************************************
The method is_admin in Application Controller
def is_admin?
logged_in? && current_user.role == Role....