test_new方法的最后两个断言失败了,我不知道,因为被测试的控制器有效。
require File.dirname(__FILE__) + '/../../test_helper'
require 'admin/supplier_controller'
# Re-raise errors caught by the controller.
class Admin::SupplierController; def rescue_action(e) raise e end; end
class Admin::SupplierControllerTest < ActionController::TestCase
fixtures :suppliers
def setup
@controller = Admin::SupplierController.new
@request = ActionController::TestRequest.new
@response = ActionController::TestResponse.new
end
def test_new
get :new
assert_template 'admin/supplier/new'
assert_tag 'h1', :content => 'Create new supplier'
assert_tag 'form', :attributes => {:action => '/admin/supplier/create'}
end
end