Skip to content

Commit

Permalink
Update activemerchant gem
Browse files Browse the repository at this point in the history
Fixes #6241
  • Loading branch information
camelmasa authored and Jeff Dutil committed Mar 30, 2015
1 parent b790948 commit 0138abe
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
4 changes: 3 additions & 1 deletion core/spec/models/spree/payment_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -521,7 +521,9 @@

context "when there is an error connecting to the gateway" do
it "should call gateway_error " do
expect(gateway).to receive(:create_profile).and_raise(ActiveMerchant::ConnectionError)
message = double("gateway_error")
connection_error = ActiveMerchant::ConnectionError.new(message, nil)
expect(gateway).to receive(:create_profile).and_raise(connection_error)
expect do
Spree::Payment.create(
:amount => 100,
Expand Down
11 changes: 7 additions & 4 deletions core/spec/models/spree/refund_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -141,10 +141,13 @@

context 'with an activemerchant gateway connection error' do
before do
expect(payment.payment_method)
.to receive(:credit)
.with(amount_in_cents, payment.source, payment.transaction_id, {originator: an_instance_of(Spree::Refund)})
.and_raise(ActiveMerchant::ConnectionError)
message = double("gateway_error")
expect(payment.payment_method).to receive(:credit).with(
amount_in_cents,
payment.source,
payment.transaction_id,
originator: an_instance_of(Spree::Refund)
).and_raise(ActiveMerchant::ConnectionError.new(message, nil))
end

it 'raises Spree::Core::GatewayError' do
Expand Down
2 changes: 1 addition & 1 deletion core/spree_core.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Gem::Specification.new do |s|
s.files = Dir['LICENSE', 'README.md', 'app/**/*', 'config/**/*', 'lib/**/*', 'db/**/*', 'vendor/**/*']
s.require_path = 'lib'

s.add_dependency 'activemerchant', '~> 1.46.0'
s.add_dependency 'activemerchant', '~> 1.47.0'
s.add_dependency 'acts_as_list', '~> 0.6'
s.add_dependency 'awesome_nested_set', '~> 3.0.1'
s.add_dependency 'carmen', '~> 1.0.0'
Expand Down

0 comments on commit 0138abe

Please sign in to comment.