Skip to content

Commit

Permalink
Rename tests for Event#rolledback
Browse files Browse the repository at this point in the history
  • Loading branch information
mayorova committed May 15, 2024
1 parent 3ccb7ce commit 1425637
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions test/unit/event_store/event_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ class EventWithCallbacks < EventStore::Event
def after_rollback_method; end
end

test 'rolledback harmless exceptions not reported' do
test 'exceptions in #rolledback! are not reported for events without transactional callbacks' do
System::ErrorReporting.expects(:report_error).with(instance_of(EventStore::Event::EventRollbackError)).never

ActiveRecord::Base.transaction do
Expand All @@ -105,7 +105,7 @@ def after_rollback_method; end
end
end

test 'failed rolledback with transactional callbacks' do
test 'exceptions in #rolledback! are reported for events with transactional callbacks' do
System::ErrorReporting.expects(:report_error).with(instance_of(EventStore::Event::EventRollbackError))

ActiveRecord::Base.transaction do
Expand All @@ -115,7 +115,7 @@ def after_rollback_method; end
end
end

test 'successful rolledback with transactional callbacks' do
test 'transactional callbacks are executed on successful #rolledback!' do
EventWithCallbacks.any_instance.expects(:after_rollback_method)

ActiveRecord::Base.transaction do
Expand Down

0 comments on commit 1425637

Please sign in to comment.