mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
Redirect to admin root after confirmation
This commit is contained in:
@@ -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
|
||||
15
spec/controllers/devise/confirmation_controller_spec.rb
Normal file
15
spec/controllers/devise/confirmation_controller_spec.rb
Normal 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
|
||||
Reference in New Issue
Block a user