测试让我觉得这个方法有错误,
def test_create
get :new
assert_template 'admin/supplier/new'
assert_difference(Supplier, :count) do
post :create, :supplier => {:name => 'Juan', :province => 'provincia'}
assert_response :redirect
assert_redirected_to :action => 'index'
end
assert_equal 'was succesfully created.', flash[:notice]
end
确切地说错误在
assert_difference(Supplier, :count) do