ruby on rails - When is Rspec true != true? -
ruby on rails - When is Rspec true != true? -
i'm going through hartl's ror tutorial, , in rspec test there's block check if passwords match. in block line:
expect(@user.has_password?(@attr[:password])).to be_true
which fails. know code works because if set line:
puts @user.has_password?(@attr[:password])
in block outputs "true." throws me set line:
expect(true).to be_true
in place of line above... , test still fails. what's that?
it seems be_true
renamed be_truthy
. seek 1 of these variants:
expect(true).to true expect(true).to be_truthy
the first 1 work true
. sec that's not false
or nil
.
ruby-on-rails ruby rspec3
Comments
Post a Comment