Shoulda::Matchers::Callbacks
Gem created from my refused 💔 Shoulda Matchers pull request thoughtbot/shoulda-matchers#353 😄
ActiveModel Matchers
Matchers to test callbacks:
describe Event do
it { should have_after_create_callback_on(:send_invitation_emails) }
it { should have_before_destroy_callback_on(:delete_calendar_entries)
}
it { should have_around_update_callback_on(:sign_other_events) }
it { should have_after_validation_callback_on(:mark_event_upcomming) }
# ... you can use any of possible ActiveRecord::Base::CALLBACKS
end
Installation
Add this line to your application's Gemfile:
gem 'shoulda-matchers-callbacks'
And then execute:
$ bundle
Or install it yourself as:
$ gem install shoulda-matchers-callbacks
Contributing
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request