Skip to content

Commit

Permalink
Merge pull request spree-contrib#211 from spree-contrib/rails_6_spree_4
Browse files Browse the repository at this point in the history
Rails 6 spree 4
  • Loading branch information
damianlegawiec authored Oct 15, 2019
2 parents 181cce8 + fa4aca4 commit 49c579a
Show file tree
Hide file tree
Showing 14 changed files with 256 additions and 278 deletions.
35 changes: 24 additions & 11 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,37 +5,50 @@ language: ruby

script:
- bundle exec rake test_app
- travis_retry bundle exec rake spec
- bundle exec rake spec

env:
- DB=mysql
- DB=postgres

addons:
chrome: stable
postgresql: 9.4

rvm:
- 2.3.7
- 2.3.8
- 2.4.4
- 2.5.1

gemfile:
- gemfiles/spree_3_2.gemfile
- gemfiles/spree_3_3.gemfile
- gemfiles/spree_3_4.gemfile
- gemfiles/spree_3_5.gemfile
- gemfiles/spree_3_7.gemfile
- gemfiles/spree_4_0.gemfile
- gemfiles/spree_master.gemfile

before_install:
- mysql -u root -e "GRANT ALL ON *.* TO 'travis'@'%';"

matrix:
exclude:
- rvm: 2.5.1
gemfile: gemfiles/spree_3_2.gemfile
- rvm: 2.5.1
gemfile: gemfiles/spree_3_3.gemfile
- rvm: 2.5.1
gemfile: gemfiles/spree_3_4.gemfile
- rvm: 2.5.1
gemfile: gemfiles/spree_3_5.gemfile
- rvm: 2.4.4
gemfile: gemfiles/spree_4_0.gemfile
- rvm: 2.3.8
gemfile: gemfiles/spree_4_0.gemfile
- rvm: 2.4.4
gemfile: gemfiles/spree_master.gemfile
- rvm: 2.3.8
gemfile: gemfiles/spree_master.gemfile
allow_failures:
- gemfile: gemfiles/spree_master.gemfile

before_install:
- mysql -u root -e "GRANT ALL ON *.* TO 'travis'@'%';"
- wget -N https://chromedriver.storage.googleapis.com/2.35/chromedriver_linux64.zip -P ~/
- unzip ~/chromedriver_linux64.zip -d ~/
- rm ~/chromedriver_linux64.zip
- sudo mv -f ~/chromedriver /usr/local/share/
- sudo chmod +x /usr/local/share/chromedriver
- sudo ln -s /usr/local/share/chromedriver /usr/local/bin/chromedriver
20 changes: 5 additions & 15 deletions Appraisals
Original file line number Diff line number Diff line change
@@ -1,18 +1,3 @@
appraise 'spree-3-2' do
gem 'spree', '~> 3.2.0'
gem 'rails-controller-testing'
end

appraise 'spree-3-3' do
gem 'spree', '~> 3.3.0'
gem 'rails-controller-testing'
end

appraise 'spree-3-4' do
gem 'spree', '~> 3.4.0'
gem 'rails-controller-testing'
end

appraise 'spree-3-5' do
gem 'spree', '~> 3.5.0'
gem 'rails-controller-testing'
Expand All @@ -23,6 +8,11 @@ appraise 'spree-3-7' do
gem 'rails-controller-testing'
end

appraise 'spree-4-0' do
gem 'spree', '~> 4.0.0.rc2'
gem 'rails-controller-testing'
end

appraise 'spree-master' do
gem 'spree', github: 'spree/spree', branch: 'master'
gem 'rails-controller-testing'
Expand Down
6 changes: 4 additions & 2 deletions app/controllers/spree/admin/payments_controller_decorator.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Spree::Admin::PaymentsController.class_eval do
module Spree::Admin::PaymentsControllerDecorator
def paypal_refund
if request.get?
if @payment.source.state == 'refunded'
Expand All @@ -16,4 +16,6 @@ def paypal_refund
end
end
end
end
end

Spree::Admin::PaymentsController.prepend Spree::Admin::PaymentsControllerDecorator
2 changes: 1 addition & 1 deletion app/models/spree/gateway/pay_pal_express.rb
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def refund(payment, amount)
:RefundSource => "any" })
refund_transaction_response = provider.refund_transaction(refund_transaction)
if refund_transaction_response.success?
payment.source.update_attributes({
payment.source.update({
:refunded_at => Time.now,
:refund_transaction_id => refund_transaction_response.RefundTransactionID,
:state => "refunded",
Expand Down
8 changes: 0 additions & 8 deletions gemfiles/spree_3_3.gemfile

This file was deleted.

8 changes: 0 additions & 8 deletions gemfiles/spree_3_4.gemfile

This file was deleted.

1 change: 1 addition & 0 deletions gemfiles/spree_3_7.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@ source "https://rubygems.org"

gem "spree", "~> 3.7.0"
gem "rails-controller-testing"
gem "sass-rails"

gemspec path: "../"
2 changes: 1 addition & 1 deletion gemfiles/spree_3_2.gemfile → gemfiles/spree_4_0.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

source "https://rubygems.org"

gem "spree", "~> 3.2.0"
gem "spree", "~> 4.0.0.rc2"
gem "rails-controller-testing"

gemspec path: "../"
Loading

0 comments on commit 49c579a

Please sign in to comment.