我在'Admin'命名空间中有一个相当简单的控制器'ActivityLogsController'。当运行rails server一切都按预期工作,我可以访问路线,如/管理/活动日志。当我运行RSpec控制器规格时,每个动作测试都会返回一个失败。例如: Failure/Error: get :index
ActionController::UrlGenerationError:
No
比方说,我有两个型号,其中一个需要其他的存在来验证: class Mother < ActiveRecord::Base
has_many :kids
end
class Kid < ActiveRecord::Base
belongs_to :mother
validates_presence_of :mother
end
当我写模型小子试验,我想要测试