<commit_before>require 'spec_helper'

describe "RailsAdmin::Adapters::ActiveRecord::AbstractObject", :active_record => true do
  describe "proxy" do
    let(:object) { mock("object") }
    let(:abstract_object) { RailsAdmin::Adapters::ActiveRecord::AbstractObject.new(object) }

    it "acts like a proxy" do
      expect(object).to receive(:method_call)
      abstract_object.method_call
    end
  end

  describe "create" do
    let(:player) { Player.new }
    let(:object) { RailsAdmin::Adapters::ActiveRecord::AbstractObject.new player }
    let(:name) { "<NAME>" }
    let(:number) { 87 }
    let(:position) { "Fifth baseman" }
    let(:suspended) { true }

    describe "a record without associations" do
      before do
        object.set_attributes({ :name => name, :number => number, :position => position, :suspended => suspended, :team_id => nil })
      end
<commit_msg>Replace mock with double<commit_after>require 'spec_helper'

describe "RailsAdmin::Adapters::ActiveRecord::AbstractObject", :active_record => true do
  describe "proxy" do
    let(:object) { double("object") }
    let(:abstract_object) { RailsAdmin::Adapters::ActiveRecord::AbstractObject.new(object) }

    it "acts like a proxy" do
      expect(object).to receive(:method_call)
      abstract_object.method_call
    end
  end

  describe "create" do
    let(:player) { Player.new }
    let(:object) { RailsAdmin::Adapters::ActiveRecord::AbstractObject.new player }
    let(:name) { "<NAME>" }
    let(:number) { 87 }
    let(:position) { "Fifth baseman" }
    let(:suspended) { true }

    describe "a record without associations" do
      before do
        object.set_attributes({ :name => name, :number => number, :position => position, :suspended => suspended, :team_id => nil })
      end

{'fraction_non_alphanumeric': 0.13843556555993247, 'fraction_numerical': 0.0022509848058525606, 'mean_word_length': 3.9664804469273744, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 17, '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': '1217645', 'n_tokens_mistral': 546, 'n_tokens_neox': 521, 'n_words': 127}