diff options
Diffstat (limited to 'railties/test')
-rw-r--r-- | railties/test/application/initializers/notifications_test.rb | 2 | ||||
-rw-r--r-- | railties/test/log_subscriber_test.rb | 18 |
2 files changed, 10 insertions, 10 deletions
diff --git a/railties/test/application/initializers/notifications_test.rb b/railties/test/application/initializers/notifications_test.rb index b99cf5bb4f..276950c78c 100644 --- a/railties/test/application/initializers/notifications_test.rb +++ b/railties/test/application/initializers/notifications_test.rb @@ -38,7 +38,7 @@ module ApplicationTests ActiveRecord::Base.logger = logger = MockLogger.new # Mimic ActiveRecord notifications - instrument "active_record.sql", :name => "SQL", :sql => "SHOW tables" + instrument "sql.active_record", :name => "SQL", :sql => "SHOW tables" wait assert_equal 1, logger.logged.size diff --git a/railties/test/log_subscriber_test.rb b/railties/test/log_subscriber_test.rb index 49288cfaa8..a3a755ae62 100644 --- a/railties/test/log_subscriber_test.rb +++ b/railties/test/log_subscriber_test.rb @@ -61,21 +61,21 @@ class SyncLogSubscriberTest < ActiveSupport::TestCase def test_event_is_sent_to_the_registered_class Rails::LogSubscriber.add :my_log_subscriber, @log_subscriber - instrument "my_log_subscriber.some_event" + instrument "some_event.my_log_subscriber" wait - assert_equal %w(my_log_subscriber.some_event), @logger.logged(:info) + assert_equal %w(some_event.my_log_subscriber), @logger.logged(:info) end def test_event_is_an_active_support_notifications_event Rails::LogSubscriber.add :my_log_subscriber, @log_subscriber - instrument "my_log_subscriber.some_event" + instrument "some_event.my_log_subscriber" wait assert_kind_of ActiveSupport::Notifications::Event, @log_subscriber.event end def test_does_not_send_the_event_if_it_doesnt_match_the_class Rails::LogSubscriber.add :my_log_subscriber, @log_subscriber - instrument "my_log_subscriber.unknown_event" + instrument "unknown_event.my_log_subscriber" wait # If we get here, it means that NoMethodError was not raised. end @@ -84,7 +84,7 @@ class SyncLogSubscriberTest < ActiveSupport::TestCase Rails.logger = nil @log_subscriber.expects(:some_event).never Rails::LogSubscriber.add :my_log_subscriber, @log_subscriber - instrument "my_log_subscriber.some_event" + instrument "some_event.my_log_subscriber" wait end @@ -110,14 +110,14 @@ class SyncLogSubscriberTest < ActiveSupport::TestCase def test_logging_does_not_die_on_failures Rails::LogSubscriber.add :my_log_subscriber, @log_subscriber - instrument "my_log_subscriber.puke" - instrument "my_log_subscriber.some_event" + instrument "puke.my_log_subscriber" + instrument "some_event.my_log_subscriber" wait assert_equal 1, @logger.logged(:info).size - assert_equal 'my_log_subscriber.some_event', @logger.logged(:info).last + assert_equal 'some_event.my_log_subscriber', @logger.logged(:info).last assert_equal 1, @logger.logged(:error).size - assert_equal 'Could not log "my_log_subscriber.puke" event. RuntimeError: puke', @logger.logged(:error).last + assert_equal 'Could not log "puke.my_log_subscriber" event. RuntimeError: puke', @logger.logged(:error).last end end
\ No newline at end of file |