2014-10-21 25 views
0

我有以下控制器色器件忽略`after_sign_up_path_for`

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 

和我的規格失敗,因爲我不是beign重定向到vendor_company_quotes_path。似乎設計忽略了我的過度使用方法。
任何人之前問,我的路線是devise_for :companies, path: "vendors", controllers: { registrations: "vendor/registrations" },我沒有使用confirmable模塊

+0

覆蓋您可以發佈您的routes.rb? – OneChillDude 2014-10-22 16:59:17

+0

已發佈在問題末尾 – 2014-10-22 17:50:24

回答

0

把你在ApplicationController

+0

同樣的行爲,沒有成功 – 2014-10-22 10:37:25