-
- Downloads
Implement `(allow|expect)_next_found_instance_of` mock helpers
Since ActiveRecord is instantiating the objects directly by calling `.allocate` on the model classes, mocking with `next_instance_of` mock helpers is not possible as it is depending on the `.new` method being called. To make it possible to mock next instance of ActiveRecord models, we had to implement a new set of mock helpers which rely on the `.allocate` method to be called.
parent
1f176abf
No related branches found
No related tags found
Showing
- doc/development/gotchas.md 14 additions, 1 deletiondoc/development/gotchas.md
- spec/spec_helper.rb 1 addition, 0 deletionsspec/spec_helper.rb
- spec/support/helpers/next_found_instance_of.rb 33 additions, 0 deletionsspec/support/helpers/next_found_instance_of.rb
- spec/workers/new_note_worker_spec.rb 3 additions, 7 deletionsspec/workers/new_note_worker_spec.rb
Please register or sign in to comment