Skip to content

Commit

Permalink
Merge pull request #3333 from nebulab/kennyasdl/deprecate-rails-5-1
Browse files Browse the repository at this point in the history
Deprecate Rails 5.1
  • Loading branch information
kennyadsl authored Oct 3, 2019
2 parents 2a6d943 + 68630fd commit 74f43ca
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 34 deletions.
20 changes: 0 additions & 20 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -103,24 +103,6 @@ jobs:
- setup
- test

postgres_rails51:
executor: postgres
parallelism: *parallelism
environment:
RAILS_VERSION: '~> 5.1.0'
steps:
- setup
- test

mysql_rails51:
executor: mysql
parallelism: *parallelism
environment:
RAILS_VERSION: '~> 5.1.0'
steps:
- setup
- test

postgres_rails52:
executor: postgres
parallelism: *parallelism
Expand Down Expand Up @@ -148,8 +130,6 @@ workflows:
only: /master|v\d\.\d/
- postgres
- mysql
- postgres_rails51
- mysql_rails51
- postgres_rails52
- mysql_rails52
- stoplight/push:
Expand Down
11 changes: 11 additions & 0 deletions core/lib/spree/core.rb
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,17 @@ class GatewayError < RuntimeError; end
end
end

if Gem::Version.new(Rails.version) < Gem::Version.new('5.2')
warn <<~HEREDOC
Rails 5.1 (EOL) is deprecated and will not be supported anymore from the next Solidus version.
Please, upgrade to a more recent Rails version.
Read more on upgrading from Rails 5.1 to Rails 5.2 here:
https://guides.rubyonrails.org/upgrading_ruby_on_rails.html#upgrading-from-rails-5-1-to-rails-5-2
HEREDOC
end

require 'spree/core/version'

require 'spree/core/active_merchant_dependencies'
Expand Down
18 changes: 4 additions & 14 deletions core/spec/models/spree/payment_create_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -156,20 +156,10 @@ module Spree
context "unpermitted" do
let(:attributes) { ActionController::Parameters.new(valid_attributes) }

if Rails.gem_version < Gem::Version.new('5.1')
it "ignores all attributes" do
expect(new_payment).to have_attributes(
amount: 0,
payment_method: nil,
source: nil
)
end
else
it "raises an exception" do
expect {
new_payment
}.to raise_exception(ActionController::UnfilteredParameters)
end
it "raises an exception" do
expect {
new_payment
}.to raise_exception(ActionController::UnfilteredParameters)
end
end

Expand Down

0 comments on commit 74f43ca

Please sign in to comment.