<commit_before>require 'spec_helper'

describe MarkChargeAsPaidService do
  let(:charge) { create(:charge, card: nil, paid: false)}
  let(:stripe_charge) { { id: 1, card: JSON.parse('{"test": "test"}') }}

    describe '#call' do
    before(:each) { MarkChargeAsPaidService.new(charge, stripe_charge).call }

    it 'sets charge.paid to be true' do
      expect(charge.paid).to eq(true)
    end

    it 'updates charge id' do
      expect(charge.stripe_id).to eq(1)
    end

    it 'updates charge card' do
      expect(charge.card).to eq(stripe_charge[:card].to_hash)
    end

    it 'creates new log entry for charge' do
      expect(charge.log_entries.last.message).to eq('Successful charge.')
    end
  end
end<commit_msg>Fix for wrong intendation in MarkChargeAsPaid spec<commit_after>require 'spec_helper'

describe MarkChargeAsPaidService do
  let(:charge) { create(:charge, card: nil, paid: false)}
  let(:stripe_charge) { { id: 1, card: JSON.parse('{"test": "test"}') }}

  describe '#call' do
    before(:each) { MarkChargeAsPaidService.new(charge, stripe_charge).call }

    it 'sets charge.paid to be true' do
      expect(charge.paid).to eq(true)
    end

    it 'updates charge id' do
      expect(charge.stripe_id).to eq(1)
    end

    it 'updates charge card' do
      expect(charge.card).to eq(stripe_charge[:card].to_hash)
    end

    it 'creates new log entry for charge' do
      expect(charge.log_entries.last.message).to eq('Successful charge.')
    end
  end
end
{'fraction_non_alphanumeric': 0.12642905178211164, 'fraction_numerical': 0.0026899798251513113, 'mean_word_length': 3.5784615384615384, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 3, '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': '1363976', 'n_tokens_mistral': 511, 'n_tokens_neox': 494, 'n_words': 131}