Wouldn't this be better as `assert_equal(course.show_chat, 'true')` ?  It would test the hasattr that you are doing, but also that it has the right value.