<commit_before># require 'rails_helper'

# RSpec.describe ReclaimItem, type: :class do
#   let(:campaign) { create(:campaign, money: 100) }
#   let(:item) { create(:item, sold: true, sold_price: 100, hero_id: nil, last_owner_id: 2) }

#   before { described_class.new(item, campaign).call }

#   it 'removes sold price from campaign money' do
#     expect(campaign.money).to eq 0
#   end

#   it 'sets sold price back to 0' do
#     expect(item.sold_price).to eq 0
#   end

#   it 'sets sold to false' do
#     expect(item.sold).to eq false
#   end

#   it 'sets last owner as owner' do
#     expect(item.hero_id).to eq 2
#   end
# end<commit_msg>Fix reclaim item spec<commit_after>require 'rails_helper'

RSpec.describe ReclaimItem, type: :class do
  let(:campaign) { create(:campaign, money: 100) }
  let(:hero) { create(:hero, id: 2) }
  let(:item) { create(:item, sold: true, sold_price: 100, hero: hero, last_owner_id: 2) }

  before { described_class.new(item, campaign).call }

  it 'removes sold price from campaign money' do
    expect(campaign.money).to eq 0
  end

  it 'sets sold price back to 0' do
    expect(item.sold_price).to eq 0
  end

  it 'sets sold to false' do
    expect(item.sold).to eq false
  end

  it 'sets last owner as owner' do
    expect(item.hero_id).to eq 2
  end
end
{'fraction_non_alphanumeric': 0.1228878648233487, 'fraction_numerical': 0.017665130568356373, 'mean_word_length': 3.4931034482758623, 'pattern_counts': {'":': 0, '<': 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': '4021738', 'n_tokens_mistral': 496, 'n_tokens_neox': 451, 'n_words': 147}