Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion core/app/models/spree/user_last_url_storer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ def self.rules
# or its subclasses. The controller will be passed to each rule for matching.
def initialize(controller)
@controller = controller
Spree::Deprecation.warn("This class will be removed without replacement on the release of Solidus 4.0")
end

# Stores into session[:spree_user_return_to] the request full path for
Expand Down
11 changes: 0 additions & 11 deletions core/lib/spree/core/controller_helpers/auth.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,6 @@ def current_ability
end

def redirect_back_or_default(default)
Spree::Deprecation.warn <<~MSG
'Please use #stored_spree_user_location_or when using solidus_auth_devise.
Otherwise, please utilize #redirect_back provided in Rails 5+ or
#redirect_back_or_to in Rails 7+ instead'
MSG

redirect_to(session["spree_user_return_to"] || default)
session["spree_user_return_to"] = nil
end
Expand All @@ -57,11 +51,6 @@ def set_guest_token
end

def store_location
Spree::Deprecation.warn <<~MSG
store_location is being deprecated in solidus 4.0
without replacement
MSG

Spree::UserLastUrlStorer.new(self).store_location
end

Expand Down
9 changes: 2 additions & 7 deletions core/spec/lib/spree/core/controller_helpers/auth_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def index; render plain: 'index'; end
describe '#redirect_back_or_default' do
before do
def controller.index
Spree::Deprecation.silence { redirect_back_or_default('/') }
redirect_back_or_default('/')
end
end

Expand All @@ -30,11 +30,6 @@ def controller.index
get :index
expect(response).to redirect_to('/')
end

it 'is deprecated' do
expect(Spree::Deprecation).to receive(:warn)
get :index
end
end

describe '#set_guest_token' do
Expand Down Expand Up @@ -74,7 +69,7 @@ def controller.index
describe '#store_location' do
it 'sets session return url' do
allow(controller).to receive_messages(request: double(fullpath: '/redirect'))
Spree::Deprecation.silence { controller.store_location }
controller.store_location
expect(session[:spree_user_return_to]).to eq '/redirect'
end
end
Expand Down
9 changes: 2 additions & 7 deletions core/spec/models/spree/user_last_url_storer_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,6 @@ def self.match?(_controller)
described_class.rules.delete('CustomRule')
end

it 'is deprecated' do
expect(Spree::Deprecation).to receive(:warn)
described_class.new(controller)
end

describe '::rules' do
it 'includes default rules' do
rule = Spree::UserLastUrlStorer::Rules::AuthenticationRule
Expand All @@ -48,7 +43,7 @@ def self.match?(_controller)
context 'when at least one rule matches' do
it 'does not set the path value into the session' do
described_class.rules << CustomRule
Spree::Deprecation.silence { subject.store_location }
subject.store_location
expect(session[:spree_user_return_to]).to be_nil
end
end
Expand All @@ -57,7 +52,7 @@ def self.match?(_controller)
it 'sets the path value into the session' do
described_class.rules << CustomRule
described_class.rules.delete('CustomRule')
Spree::Deprecation.silence { subject.store_location }
subject.store_location
expect(session[:spree_user_return_to]).to eql fullpath
end
end
Expand Down