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

Popular posts from this blog

c - Compilation of a code: unkown type name string -

java - Bypassing "final local variable defined in an enclosing type" -

json - Hibernate and Jackson (java.lang.IllegalStateException: Cannot call sendError() after the response has been committed) -