« Return to Thread: "warning: object#id will be deprecated" with mocks

"warning: object#id will be deprecated" with mocks

by David Green :: Rate this Message:

Reply to Author | View in Thread

hi all

I have the following code in a spec:
 
  @user = mock("user")
  User.stub!(:authenticate).and_return(@user)
  @user.should_receive(:id).once.and_return(99)
  post :login, {:username => 'username', :password => 'password'}
  session[:user_id].should == 99

it works as expected but I get the following warning when I run the spec:
 warning: object#id will be deprecated; use Object#object_id instead

I'm new to testing with mocks, am I using them correctly and does anyone know how to disable the warning?

thanks

 « Return to Thread: "warning: object#id will be deprecated" with mocks