Sha256: 36ee8dbde3cbbdee0762f9aae39232a947e743fe907d0fbcce60f532f9d7d5fa

Contents?: true

Size: 449 Bytes

Versions: 8

Compression:

Stored size: 449 Bytes

Contents

require 'spec_helper'
class AfterRecordUpdateNoArityCollection < RecordCollection::Base
  attribute :section
  attribute :admin
  after_record_update{ do_a_trick }
end

RSpec.describe AfterRecordUpdateNoArityCollection do
  subject { described_class.new }
  it "triggers the method" do
    employee = Employee.create section: 'SE1', admin: false
    expect( employee ).to receive :do_a_trick
    described_class.new([employee]).update({})
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
record_collection-0.10.4 spec/base/after_record_update_no_arity_spec.rb
record_collection-0.10.3 spec/base/after_record_update_no_arity_spec.rb
record_collection-0.10.2 spec/base/after_record_update_no_arity_spec.rb
record_collection-0.10.1 spec/base/after_record_update_no_arity_spec.rb
record_collection-0.10.0 spec/base/after_record_update_no_arity_spec.rb
record_collection-0.9.2 spec/base/after_record_update_no_arity_spec.rb
record_collection-0.9.1 spec/base/after_record_update_no_arity_spec.rb
record_collection-0.9.0 spec/base/after_record_update_no_arity_spec.rb