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: store_credit_test.rb
    path of file: ./repos/workarea/core/test/models/workarea/payment/purchase
    
    the code of the file until where you have to start completion: require 'test_helper'

module Workarea
  class Payment
    module Purchase
      class StoreCreditTest < TestCase
        def profile
          @profile ||= create_payment_profile(store_credit: 15.to_m)
        end

        def payment
          @payment ||= create_payment(profile: profile)
        end

        def tender
          @tender ||= begin
            payment.set_store_credit
            payment.store_
    
        def test_cancel!
          transaction = tender.build_transaction(amount: 5.to_m, success: false)
          operation = StoreCredit.new(tender, transaction)

          operation.cancel!
          profile.reload

          assert_equal(15.to_m, profile.store_credit)

          transaction = tender.build_transaction(amount: 5.to_m, success: true)
          operation = StoreCredit.new(tender, transaction)

          operation.cancel!
          profile.reload

          assert_equal(20.to_m, profile.store_credit)
          assert_equal(
            ActiveMerchant::Billing::Response,
            transaction.cancellation.class
          )
        end