Skip to content

equivalent/shoulda-matchers-callbacks

Repository files navigation

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

About

Shoulda Matchers gem extension for Active Model (Rails) callbacks

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages