<commit_before>require "test_helper"

class UserMailerTest < ActionMailer::TestCase
  setup do
    @user = User.new(email: "<EMAIL>", extra_billing_info: "extra billing info")
    @charge = @user.charges.new(amount: 100, created_at: Time.zone.now)
  end

  test "receipt" do
    email = Pay::UserMailer.with(billable: @user, charge: @charge).receipt

    assert_equal [@user.email], email.to
    assert_equal Pay.email_receipt_subject, email.subject
  end

  test "attaches refunds to receipt" do
    filename = "receipt.pdf"

    receipt = mock("receipt")
    receipt.stubs(:render).returns("render content")
    receipt.stubs(:length).returns(1024)

    @charge.stubs(:filename).returns(filename)
    @charge.stubs(:receipt).returns(receipt)
<commit_msg>Fix test<commit_after>require "test_helper"

class UserMailerTest < ActionMailer::TestCase
  setup do
    @user = User.new(email: "<EMAIL>", extra_billing_info: "extra billing info")
    @charge = @user.charges.new(amount: 100, created_at: Time.zone.now)
  end

  test "receipt" do
    email = Pay::UserMailer.with(billable: @user, charge: @charge).receipt

    assert_equal [@user.email], email.to
    assert_equal I18n.t("pay.user_mailer.receipt.subject"), email.subject
  end

  test "attaches refunds to receipt" do
    filename = "receipt.pdf"

    receipt = mock("receipt")
    receipt.stubs(:render).returns("render content")
    receipt.stubs(:length).returns(1024)

    @charge.stubs(:filename).returns(filename)
    @charge.stubs(:receipt).returns(receipt)

{'fraction_non_alphanumeric': 0.13591595535128037, 'fraction_numerical': 0.010505581089954037, 'mean_word_length': 4.501805054151625, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '654574', 'n_tokens_mistral': 548, 'n_tokens_neox': 502, 'n_words': 101}