这是我写为 project_test.rb 的单元测试
require 'test_helper'
class ProjectTest < ActiveSupport::TestCase
test "projects" do
visit new_project_path
click_link "new_Project"
fill_in "Title", :with => "test app"
fill_in "Project_type", :with => "basic"
fill_date "Date_fielded" , :with => "2012/12/3"
fill_in "Owner name", :with => "chetan"
fill_in "Status", :with => "new"
fill_in "Brand", :with => "nike"
click_link "Create_Project"
end
end
我将此视为错误
1) Error:
test_projects(ProjectTest):
NameError: undefined local variable or method `new_projects_path' for #<ProjectTest:0xaa6a25c>
test/unit/project_test.rb:5:in `block in <class:ProjectTest>'
我尝试更改路径以检查路径中的错误,但这没有用,还检查了 rake 路由以检查路径