Module: EvelpidonTestHelpers::ActiveModel::Observers::Assertions
- Included in:
- ActiveSupport::TestCase
- Defined in:
- lib/evelpidon_test_helpers/active_model/observers.rb
Instance Method Summary collapse
-
#assert_observer_not_notified(observer, notification, options = {}) ⇒ Object
Asserts that the given
observerclass will never receive thenotification. -
#assert_observer_notified(observer, notification, options = {}) ⇒ Object
Asserts that the given
observerclass will receive thenotification.
Instance Method Details
#assert_observer_not_notified(observer, notification, options = {}) ⇒ Object
Asserts that the given observer class will never receive the notification.
24 25 26 |
# File 'lib/evelpidon_test_helpers/active_model/observers.rb', line 24 def assert_observer_not_notified(observer, notification, = {}) observer.instance.expects(notification).never end |
#assert_observer_notified(observer, notification, options = {}) ⇒ Object
Asserts that the given observer class will receive the notification.
13 14 15 16 |
# File 'lib/evelpidon_test_helpers/active_model/observers.rb', line 13 def assert_observer_notified(observer, notification, = {}) .reverse_merge!(:times => 1, :object => anything) observer.instance.expects(notification).with([:object]).times([:times]) end |