blob: 1c449d42feeeae79c54020e2131392ebb1e4a76d (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
require 'cases/helper'
require 'models/notification'
require 'models/user'
class SuppressorTest < ActiveRecord::TestCase
def test_suppresses_creation_of_record_generated_by_callback
assert_difference -> { User.count } do
assert_no_difference -> { Notification.count } do
Notification.suppress { UserWithNotification.create! }
end
end
end
def test_resumes_saving_after_suppression_complete
Notification.suppress { UserWithNotification.create! }
assert_difference -> { Notification.count } do
Notification.create!
end
end
end
|