Redirect to admin root after confirmation

This commit is contained in:
Rob Harrington
2014-10-16 16:06:54 +11:00
parent a6480e6831
commit 7db68795a4
2 changed files with 22 additions and 0 deletions

View File

@@ -0,0 +1,7 @@
Devise::ConfirmationsController.class_eval do
protected
# Override of devise method in Devise::ConfirmationsController
def after_confirmation_path_for(resource_name, resource)
spree.admin_path
end
end

View File

@@ -0,0 +1,15 @@
require 'spec_helper'
describe Devise::ConfirmationsController do
context "after confirmation" do
before do
e = create(:enterprise)
@request.env["devise.mapping"] = Devise.mappings[:enterprise]
spree_get :show, confirmation_token: e.confirmation_token
end
it "should redirect to admin root" do
expect(response).to redirect_to spree.admin_path
end
end
end