search for: devsu

Displaying 1 result from an estimated 1 matches for "devsu".

Did you mean: devs
2007 Sep 11
1
Can NOT overides the stub! in the setup
Hello, I am new to rSpec. I tried to search in the list, but could not find the answer, please forgive me if somebody already answered this. Here is my question: I have a stub in setup: before(:each) do @current_user = mock("devsu") # Generally, prefer stub! over should_receive in setup. User.stub!(:find).and_return(@current_user) session[:user] = @current_user.id end Where User is a model. Then I tried to overrides it within a spec in a rails CONTROLLER specs: it "descriptions...." do .....