mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-27 06:05:19 +00:00
Remove more dead code from usersregistration (signup calls are always ajax)
This commit is contained in:
@@ -21,10 +21,6 @@ class UserRegistrationsController < Spree::UserRegistrationsController
|
||||
associate_user
|
||||
|
||||
respond_to do |format|
|
||||
format.html do
|
||||
set_flash_message(:success, :signed_up_but_unconfirmed)
|
||||
redirect_to after_sign_in_path_for(@user)
|
||||
end
|
||||
format.js do
|
||||
render json: { email: @user.email }
|
||||
end
|
||||
|
||||
@@ -59,24 +59,4 @@ describe UserRegistrationsController, type: :controller do
|
||||
cookies[:locale] = original_locale_cookie
|
||||
end
|
||||
end
|
||||
|
||||
context "when registration succeeds" do
|
||||
context "when referer is not '/checkout'" do
|
||||
it "redirects to root" do
|
||||
spree_post :create, spree_user: {email: "test@test.com", password: "testy123", password_confirmation: "testy123"}, :use_route => :spree
|
||||
expect(response).to redirect_to root_path
|
||||
expect(assigns[:user].email).to eq("test@test.com")
|
||||
end
|
||||
end
|
||||
|
||||
context "when referer is '/checkout'" do
|
||||
before { @request.env['HTTP_REFERER'] = 'http://test.com/checkout' }
|
||||
|
||||
it "redirects to checkout" do
|
||||
spree_post :create, spree_user: {email: "test@test.com", password: "testy123", password_confirmation: "testy123"}, :use_route => :spree
|
||||
expect(response).to redirect_to checkout_path
|
||||
expect(assigns[:user].email).to eq("test@test.com")
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user