shoulda-callback-matchers icon indicating copy to clipboard operation
shoulda-callback-matchers copied to clipboard

Test existence of your Rails callbacks without having to call them

Results 9 shoulda-callback-matchers issues
Sort by recently updated
recently updated
newest added

Does it supports `after_commit` and `after_create_commit` callbacks?

Upgrading from Rails 5.1.5 to 5.2.0 results in `ArgumentError: wrong number of arguments (given 1, expected 0)` for `callback(:after_commit_callback).after(:commit).on(:create)`

hello and thank you for your work, I have the following test case that doesn't seem to work: test class ``` class Template::Box < ActiveRecord::Base before_validation :set_initial_position, if: ->(box){ box.position.blank?...

enhancement
help wanted

Can we check if the callbacks got triggered in correct order or not

Hi, After upgrading Rails from 4.1.14 to 4.2, I'm getting this error in my specs consultation.rb ``` after_commit :schedule_staff_notifier, on: :create, if: :persisted? ``` consultation_spec.rb ``` it { expect(consultation).to callback(:schedule_staff_notifier).after(:commit).on(:create)...

Hello. Most of the times happens that either me or my CI can't build this gem. ``` Gem::Ext::BuildError: ERROR: Failed to build gem native extension. can't modify frozen String Gem...

I just added this gem, and I am now unable to run any tests or start my spork server. **Gemfile:** ``` group :development, :test do gem 'rspec-rails' gem 'factory_girl_rails' gem...

In long winded statements like: ``` rspec it { is_expected.to callback(:foo).after(:update).if(:something_is_true) ``` it would be helpful to have indications in the failure message which assertion of the three chained assertions...

enhancement
help wanted