You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: transaction_test.rb
    path of file: ./repos/workarea/core/test/models/workarea/inventory
    
    the code of the file until where you have to start completion: require 'test_helper'

module Workarea
  module Inventory
    class TransactionTest < TestCase
      setup :setup_order

      def setup_order
        @order_id = '124'
        @sku = 'SKU'
        @quantity = 2
        @items = { @sku => @quantity }
        @txn = Tr
    
      def test_backordered_restock_with_expired_backorder
        sku = create_inventory(
          id: 'SKU1',
          policy: 'allow_backorder',
          available: 2,
          backordered: 2,
          backordered_until: 1.week.from_now,
          purchased: 0
        )

        txn = Transaction.new(order_id: @order_id, captured: true)
        txn.items.build(sku: 'SKU1', total: 4)

        txn.purchase

        travel_to 2.weeks.from_now
        txn.restock('SKU1' => 3)

        assert(txn.captured?)
        assert_equal(0, txn.items.first.available)
        assert_equal(1, txn.items.first.backordered)

        sku.reload
        assert_equal(3, sku.available)
        assert_equal(0, sku.backordered)
        assert_equal(1, sku.purchased)
      end