how should we check not null in rspec
user_valid = @user.valid?
password_credential_valid = @password.valid?
I am getting the below error
Mock 'User_1001' received unexpected message :valid? with (no args)
Diwa
how should we check not null in rspec
user_valid = @user.valid?
password_credential_valid = @password.valid?
I am getting the below error
Mock 'User_1001' received unexpected message :valid? with (no args)
Diwa
On Mon, May 25, 2009 at 6:51 AM, Diwakar, ANGLER - EIT
[email protected] wrote:
how should we check not null in rspec
user_valid = @user.valid? password_credential_valid = @password.valid?
I am getting the below error
Mock 'User_1001' received unexpected message :valid? with (no args)
Assuming that @user is the same mock object that is causing the error,
you need to tell the @user that it should receive valid?:
@user.should_receive(:valid?).and_return(true)
I’m not sure what this has to do with checking for not null.
Thank you David it works
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.
Sponsor our Newsletter | Privacy Policy | Terms of Service | Remote Ruby Jobs