No commit activity in last 3 years
No release in over 3 years
Shoulda Matchers gem extension for Active Model (Rails) callbacks (after_create, before_create, after_update, before_update...)
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.3
~> 3.0
>= 0
< 3, >= 2.13.1
 Project Readme

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

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request