Sha256: 3803dd873753b8210a54c775dee7342de1e697149b7ffa10c5da6bf62a9a6b28

Contents?: true

Size: 535 Bytes

Versions: 6

Compression:

Stored size: 535 Bytes

Contents

require 'spec_helper'

RSpec.describe ActsAsScrubbable::UpdateProcessor do
  let(:ar_class) { ScrubbableModel }
  let(:model) { ar_class.create(
    first_name: "Ted",
    last_name: "Lowe",
  ) }
  subject { described_class.new(ar_class) }

  describe "#handle_batch" do
    it "calls update with the updated attributes" do
      expect(model).to receive(:scrubbed_values).and_call_original
      expect(model).to receive(:update_columns).and_call_original

      expect(subject.send(:handle_batch, [model])).to eq 1
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
acts_as_scrubbable-2.1.3 spec/lib/acts_as_scrubbable/update_processor_spec.rb
acts_as_scrubbable-2.1.2 spec/lib/acts_as_scrubbable/update_processor_spec.rb
acts_as_scrubbable-2.1.1 spec/lib/acts_as_scrubbable/update_processor_spec.rb
acts_as_scrubbable-2.0.0 spec/lib/acts_as_scrubbable/update_processor_spec.rb
acts_as_scrubbable-1.4.0 spec/lib/acts_as_scrubbable/update_processor_spec.rb
acts_as_scrubbable-1.2.1 spec/lib/acts_as_scrubbable/update_processor_spec.rb