Skip to content

Commit

Permalink
Merge pull request #2826 from nebulab/ransack-rails-5.2.1
Browse files Browse the repository at this point in the history
Compatibility with Rails 5.2.1 & Ransack
  • Loading branch information
tvdeyen authored Aug 28, 2018
2 parents 425240b + 3f027e2 commit 8a58bc5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
4 changes: 2 additions & 2 deletions core/solidus_core.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ Gem::Specification.new do |s|
s.add_dependency 'discard', '~> 1.0'
s.add_dependency 'friendly_id', '~> 5.0'
s.add_dependency 'kaminari-activerecord', '~> 1.1'
s.add_dependency 'monetize', '~> 1.1'
s.add_dependency 'monetize', '~> 1.8.0'
s.add_dependency 'paperclip', ['>= 4.2', '< 6']
s.add_dependency 'paranoia', '~> 2.4'
s.add_dependency 'ransack', '~> 1.8'
s.add_dependency 'ransack', '~> 2.0'
s.add_dependency 'state_machines-activerecord', '~> 0.4'
end
9 changes: 5 additions & 4 deletions core/spec/models/spree/order_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -379,13 +379,13 @@ def merge!(other_order, user = nil)

it "does nothing if any shipments are ready" do
shipment = create(:shipment, order: subject, state: "ready")
expect { subject.ensure_updated_shipments }.not_to change { subject.reload.shipments }
expect { subject.ensure_updated_shipments }.not_to change { subject.reload.shipments.pluck(:id) }
expect { shipment.reload }.not_to raise_error
end

it "does nothing if any shipments are shipped" do
shipment = create(:shipment, order: subject, state: "shipped")
expect { subject.ensure_updated_shipments }.not_to change { subject.reload.shipments }
expect { subject.ensure_updated_shipments }.not_to change { subject.reload.shipments.pluck(:id) }
expect { shipment.reload }.not_to raise_error
end
end
Expand Down Expand Up @@ -1102,11 +1102,12 @@ def generate

it "raises an error if any shipments are ready" do
shipment = create(:shipment, order: subject, state: "ready")

expect {
expect {
subject.create_proposed_shipments
}.to raise_error(Spree::Order::CannotRebuildShipments)
}.not_to change { subject.reload.shipments }
}.not_to change { subject.reload.shipments.pluck(:id) }

expect { shipment.reload }.not_to raise_error
end
Expand All @@ -1117,7 +1118,7 @@ def generate
expect {
subject.create_proposed_shipments
}.to raise_error(Spree::Order::CannotRebuildShipments)
}.not_to change { subject.reload.shipments }
}.not_to change { subject.reload.shipments.pluck(:id) }

expect { shipment.reload }.not_to raise_error
end
Expand Down

0 comments on commit 8a58bc5

Please sign in to comment.