0
이 코드했습니다 :루비 테스트
def test_create
assert_difference('Comment.count') do
post :create, :comment => {:comment => 'Comment'}
assert_not_nil assigns(:comment)
assert_equal assigns(:comment).comment, "Comment"
assert_equal assigns(:comment).valid?, true
end
assert_response :redirect
assert_redirected_to article_path(assigns(:comment))
assert_equal flash[:notice], 'Comment was successfully created.'
end
을 그리고 테스트하려고하지만, 반환 :
test_create(CommentsControllerTest) [test/functional/comments_controller_test.rb:5]:
<nil> expected to not be nil.
이 코드에 어떤 문제가 있습니까? 제발 도와주세요. 나는 레일즈에있는 초보자입니다.