Sha256: 4d158a2cc8a6ed25a9033169109a4f56288eb933cbfe5f247a772ce00c45f0e8

Contents?: true

Size: 452 Bytes

Versions: 8

Compression:

Stored size: 452 Bytes

Contents

require 'spec_helper'
class BeforeRecordUpdateNoArityCollection < RecordCollection::Base
  attribute :section
  attribute :admin
  before_record_update{ do_a_trick }
end

RSpec.describe BeforeRecordUpdateNoArityCollection 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/before_record_update_no_arity_spec.rb
record_collection-0.10.3 spec/base/before_record_update_no_arity_spec.rb
record_collection-0.10.2 spec/base/before_record_update_no_arity_spec.rb
record_collection-0.10.1 spec/base/before_record_update_no_arity_spec.rb
record_collection-0.10.0 spec/base/before_record_update_no_arity_spec.rb
record_collection-0.9.2 spec/base/before_record_update_no_arity_spec.rb
record_collection-0.9.1 spec/base/before_record_update_no_arity_spec.rb
record_collection-0.9.0 spec/base/before_record_update_no_arity_spec.rb