Sha256: cfb8a7f883ac252a7e6a5c46aac2fb0cfe221ea43fd50997bb296cd00167da14
Contents?: true
Size: 1.36 KB
Versions: 8
Compression:
Stored size: 1.36 KB
Contents
# frozen_string_literal: true RSpec.describe Spree::Shipment do describe '.between' do it 'delegates to BetweenQuery' do shipment = build_stubbed(:shipment) allow(SolidusBacktracs::Shipment::BetweenQuery).to receive(:apply).with( any_args, from: Time.zone.yesterday, to: Time.zone.today, ).and_return([shipment]) result = Spree::Deprecation.silence do described_class.between(Time.zone.yesterday, Time.zone.today) end expect(result).to eq([shipment]) end it 'prints a deprecation warning' do allow(Spree::Deprecation).to receive(:warn) described_class.between(Time.zone.yesterday, Time.zone.today) expect(Spree::Deprecation).to have_received(:warn).with(/Spree::Shipment\.between/) end end describe '.exportable' do it 'delegates to ExportableQuery' do shipment = build_stubbed(:shipment) allow(SolidusBacktracs::Shipment::ExportableQuery).to receive(:apply).and_return([shipment]) result = Spree::Deprecation.silence do described_class.exportable end expect(result).to eq([shipment]) end it 'prints a deprecation warning' do allow(Spree::Deprecation).to receive(:warn) described_class.exportable expect(Spree::Deprecation).to have_received(:warn).with(/Spree::Shipment\.exportable/) end end end
Version data entries
8 entries across 8 versions & 2 rubygems