我有以下控制器
class Vendor::RegistrationsController < Devise::RegistrationsController
def new
redirect_to new_vendor_company_path
end
protected
def after_sign_up_path_for(resource)
vendor_company_quotes_path(resource.secret)
end
end
和这个规范
describe "POST create" do
it "should create a new vendor" do
profile = attributes_for(:company)
post :create, { company: profile }
expect(response).to redirect_to vendor_company_quotes_path(assigns(:company).secret)
end
end
我的规格失败了,因为我没有重新定向到vendor_company_quotes_path
。似乎设计忽略了我的压倒性方法
在有人问之前,我的路线是devise_for :companies, path: "vendors", controllers: { registrations: "vendor/registrations" }
而我没有使用confirmable
模块
答案 0 :(得分:0)
将您的覆盖置于ApplicationController