solidus_core 2.0.1 → 2.0.2

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of solidus_core might be problematic. Click here for more details.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 28837b199c6bd4e7ce50f563024c4bba87df8ba2
4
- data.tar.gz: 5ef299ef80511e203b2fe84419aa13fa6d7b255b
3
+ metadata.gz: f4cd6430d3c1e5e19bb9548632a70531888a50fd
4
+ data.tar.gz: 8ebdda8f5f4cbb1f4a1aff2d9c9aeb4590a5ac99
5
5
  SHA512:
6
- metadata.gz: f296ea6422bf82a2a40ae202bb156f6af769e34eae871beb95b065b94f1fea614e33f277faa7be3841089f43725a1a3fe95e11e3cd2127d20f8361829a2a76a0
7
- data.tar.gz: 87111e8518daa11b8290566aa98fe8ed1af95dc29ddd4b34074c76d4bb2f6d1203989a1f71e464b27b8faec661fe647f52823cc644b7dc43676f891bc218f6ca
6
+ metadata.gz: 7949cdb760035f8934188282eda1bdb3e847f96b86f65fb1af42c6e9c295a9373f8801d15a2c6eb51c371d18b26cbbf1920055ab710198039b97173699453db3
7
+ data.tar.gz: f64d4a9cb6429ac91d365022386edabec822ac6f54b7b57588fd8c8264f584ca409a4063e71df4484dd6c00dc44f8e1c841df1f2e42110f2c16dbafd07121e00
@@ -5,7 +5,7 @@ module Spree
5
5
  end
6
6
 
7
7
  def self.solidus_version
8
- "2.0.1"
8
+ "2.0.2"
9
9
  end
10
10
 
11
11
  def self.solidus_gem_version
@@ -201,10 +201,12 @@ describe Spree::OrderInventory, type: :model do
201
201
  end
202
202
 
203
203
  it 'should destroy self if not inventory units remain' do
204
- allow(shipment.inventory_units).to receive_messages(count: 0)
205
- expect(shipment).to receive(:destroy)
204
+ shipment.inventory_units[1...999].each(&:destroy)
205
+ shipment.inventory_units.reload
206
206
 
207
- expect(subject.send(:remove_from_shipment, shipment, 1)).to eq(1)
207
+ expect {
208
+ expect(subject.send(:remove_from_shipment, shipment, 1)).to eq(1)
209
+ }.to change{ order.shipments.count }.from(1).to(0)
208
210
  end
209
211
 
210
212
  context "inventory unit line item and variant points to different products" do
@@ -17,12 +17,12 @@ describe Spree::Payment, type: :model do
17
17
  let(:card) { create :credit_card }
18
18
 
19
19
  let(:payment) do
20
- payment = Spree::Payment.new
21
- payment.source = card
22
- payment.order = order
23
- payment.payment_method = gateway
24
- payment.amount = 5
25
- payment
20
+ Spree::Payment.create! do |payment|
21
+ payment.source = card
22
+ payment.order = order
23
+ payment.payment_method = gateway
24
+ payment.amount = 5
25
+ end
26
26
  end
27
27
 
28
28
  let(:amount_in_cents) { (payment.amount * 100).round }
@@ -39,11 +39,6 @@ describe Spree::Payment, type: :model do
39
39
  ActiveMerchant::Billing::Response.new(false, '', {}, {})
40
40
  end
41
41
 
42
- before(:each) do
43
- # So it doesn't create log entries every time a processing method is called
44
- allow(payment.log_entries).to receive(:create!)
45
- end
46
-
47
42
  context '.risky' do
48
43
  let!(:payment_1) { create(:payment, avs_response: 'Y', cvv_response_code: 'M', cvv_response_message: 'Match') }
49
44
  let!(:payment_2) { create(:payment, avs_response: 'Y', cvv_response_code: 'M', cvv_response_message: '') }
@@ -246,8 +241,9 @@ describe Spree::Payment, type: :model do
246
241
 
247
242
  it "should log the response" do
248
243
  payment.save!
249
- expect(payment.log_entries).to receive(:create!).with(details: anything)
250
- payment.authorize!
244
+ expect {
245
+ payment.authorize!
246
+ }.to change { payment.log_entries.count }.by(1)
251
247
  end
252
248
 
253
249
  describe 'billing_address option' do
@@ -355,8 +351,9 @@ describe Spree::Payment, type: :model do
355
351
 
356
352
  it "should log the response" do
357
353
  payment.save!
358
- expect(payment.log_entries).to receive(:create!).with(details: anything)
359
- payment.purchase!
354
+ expect {
355
+ payment.purchase!
356
+ }.to change { payment.log_entries.count }.by(1)
360
357
  end
361
358
 
362
359
  context "if successful" do
@@ -532,8 +529,9 @@ describe Spree::Payment, type: :model do
532
529
  end
533
530
 
534
531
  it "should log the response" do
535
- expect(payment.log_entries).to receive(:create!).with(details: anything)
536
- payment.void_transaction!
532
+ expect {
533
+ payment.void_transaction!
534
+ }.to change { payment.log_entries.count }.by(1)
537
535
  end
538
536
 
539
537
  context "if successful" do
@@ -691,6 +689,8 @@ describe Spree::Payment, type: :model do
691
689
  end
692
690
 
693
691
  it "should not try to create profiles on old failed payment attempts" do
692
+ order.payments.destroy_all
693
+
694
694
  allow_any_instance_of(Spree::Payment).to receive(:payment_method) { gateway }
695
695
 
696
696
  order.payments.create!(
@@ -554,7 +554,8 @@ describe Spree::Promotion, type: :model do
554
554
  allow(rule2).to receive_messages(eligible?: true, applicable?: true)
555
555
 
556
556
  promotion.promotion_rules = [rule1, rule2]
557
- allow(promotion.promotion_rules).to receive(:for).and_return(promotion.promotion_rules)
557
+ allow(promotion).to receive_message_chain(:rules, :none?).and_return(false)
558
+ allow(promotion).to receive_message_chain(:rules, :for).and_return(promotion.promotion_rules)
558
559
  end
559
560
  it "returns the eligible rules" do
560
561
  expect(promotion.eligible_rules(promotable)).to eq [rule1, rule2]
@@ -572,7 +573,8 @@ describe Spree::Promotion, type: :model do
572
573
  allow(rule2).to receive_messages(eligible?: false, applicable?: true, eligibility_errors: errors)
573
574
 
574
575
  promotion.promotion_rules = [rule1, rule2]
575
- allow(promotion.promotion_rules).to receive(:for).and_return(promotion.promotion_rules)
576
+ allow(promotion).to receive_message_chain(:rules, :none?).and_return(false)
577
+ allow(promotion).to receive_message_chain(:rules, :for).and_return(promotion.promotion_rules)
576
578
  end
577
579
  it "returns nil" do
578
580
  expect(promotion.eligible_rules(promotable)).to be_nil
@@ -604,7 +606,8 @@ describe Spree::Promotion, type: :model do
604
606
  allow(rule).to receive_messages(eligible?: false, applicable?: true, eligibility_errors: errors)
605
607
 
606
608
  promotion.promotion_rules = [rule]
607
- allow(promotion.promotion_rules).to receive(:for).and_return(promotion.promotion_rules)
609
+ allow(promotion).to receive_message_chain(:rules, :for).and_return(promotion.promotion_rules)
610
+ allow(promotion).to receive_message_chain(:rules, :none?).and_return(false)
608
611
  end
609
612
  it "returns nil" do
610
613
  expect(promotion.eligible_rules(promotable)).to be_nil
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: solidus_core
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.1
4
+ version: 2.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Solidus Team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-12-22 00:00:00.000000000 Z
11
+ date: 2017-06-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activemerchant
@@ -1409,7 +1409,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
1409
1409
  version: '0'
1410
1410
  requirements: []
1411
1411
  rubyforge_project:
1412
- rubygems_version: 2.5.2
1412
+ rubygems_version: 2.6.11
1413
1413
  signing_key:
1414
1414
  specification_version: 4
1415
1415
  summary: Essential models, mailers, and classes for the Solidus e-commerce project.