File tree Expand file tree Collapse file tree 1 file changed +16
-7
lines changed
Expand file tree Collapse file tree 1 file changed +16
-7
lines changed Original file line number Diff line number Diff line change 507507 end
508508 end
509509
510- context "updates cost when selected shipping rate is present" do
511- let ( :shipment ) { create ( :shipment ) }
512- before { shipment . selected_shipping_rate . update! ( cost : 5 ) }
510+ describe "#update_amounts" do
511+ let ( :shipment ) { create ( :shipment , cost : 3 ) }
513512
514- it "updates shipment totals" do
515- expect {
516- shipment . update_amounts
517- } . to change { shipment . cost } . to ( 5 )
513+ context 'when the selected shipping rate cost is different than the current shipment cost' do
514+ before { shipment . selected_shipping_rate . update! ( cost : 5 ) }
515+
516+ it "updates the shipments cost" do
517+ expect {
518+ shipment . update_amounts
519+ } . to change { shipment . reload . cost } . to ( 5 )
520+ end
521+
522+ it 'changes the updated_at column' do
523+ expect {
524+ shipment . update_amounts
525+ } . to change { shipment . reload . updated_at }
526+ end
518527 end
519528 end
520529
You can’t perform that action at this time.
0 commit comments