ruby功能测试出错

时间:2014-05-12 17:46:18

标签: ruby-on-rails ruby ruby-test

这是我的测试

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 'Supplier Juan was succesfully created.', flash[:notice]
end

当我执行它时,这是它显示的错误

test_create(Admin::SupplierControllerTest) [supplier_controller_test.rb:25]:
expecting <"admin/supplier/new"> but rendering with <"">

assert_template“admin / supplier / new”失败了什么?

0 个答案:

没有答案