0
test "login logout user is not online" do
get :login, :id=>1
before = User.find(1).is_online
get :logout, :id=>1
after = User.find(1).is_online
puts before
puts after
assert before == 1
assert after == 0
the output is
1
0
<false> is not true.
test/functional/users_controller_test.rb:22:in `test_login_logout_user_is_not_online'
什麼is_online定義爲?它是一個布爾字段嗎? – 2011-04-19 08:37:44
之前和之後都不是字符串,對吧? – 2011-04-19 08:42:36
is_online定義爲二進制,確定這是錯誤的,但爲什麼這不起作用? – 2011-04-19 08:47:12