5737: Fixed several warning messages from running tests.
[arvados.git] / services / api / test / unit / log_test.rb
index fd71576dfeeac3effe9d2e0ec16007ec26e9174b..92976e0053580eafa45707febfe753fd08f43c9b 100644 (file)
@@ -6,7 +6,7 @@ class LogTest < ActiveSupport::TestCase
   EVENT_TEST_METHODS = {
     :create => [:created_at, :assert_nil, :assert_not_nil],
     :update => [:modified_at, :assert_not_nil, :assert_not_nil],
-    :destroy => [nil, :assert_not_nil, :assert_nil],
+    :delete => [nil, :assert_not_nil, :assert_nil],
   }
 
   setup do
@@ -116,7 +116,7 @@ class LogTest < ActiveSupport::TestCase
     orig_attrs = auth.attributes
     orig_attrs.delete 'api_token'
     auth.destroy
-    assert_logged(auth, :destroy) do |props|
+    assert_logged(auth, :delete) do |props|
       assert_equal(orig_etag, props['old_etag'], "destroyed auth etag mismatch")
       assert_equal(orig_attrs, props['old_attributes'],
                    "destroyed auth attributes mismatch")
@@ -230,7 +230,7 @@ class LogTest < ActiveSupport::TestCase
     auth.save!
     assert_logged_with_clean_properties(auth, :update, 'api_token')
     auth.destroy
-    assert_logged_with_clean_properties(auth, :destroy, 'api_token')
+    assert_logged_with_clean_properties(auth, :delete, 'api_token')
   end
 
   test "use ownership and permission links to determine which logs a user can see" do
@@ -253,7 +253,8 @@ class LogTest < ActiveSupport::TestCase
                                       :crunchstat_for_running_job] # log & job owned by active
 
     c = Log.readable_by(users(:spectator)).order("id asc").each.to_a
-    assert_log_result c, known_logs, [:admin_changes_specimen, # owned by spectator
+    assert_log_result c, known_logs, [:noop,                   # object_uuid is spectator
+                                      :admin_changes_specimen, # object_uuid is a specimen owned by spectator
                                       :system_adds_baz] # readable via 'all users' group
   end
 
@@ -262,7 +263,7 @@ class LogTest < ActiveSupport::TestCase
     # appear too, but only if they are _not_ listed in known_logs
     # (i.e., we do not make any assertions about logs not mentioned in
     # either "known" or "expected".)
-    result_ids = result.collect &:id
+    result_ids = result.collect(&:id)
     expected_logs.each do |want|
       assert_includes result_ids, logs(want).id
     end
@@ -282,7 +283,7 @@ class LogTest < ActiveSupport::TestCase
       coll.save!
       assert_logged_with_clean_properties(coll, :update, 'manifest_text')
       coll.destroy
-      assert_logged_with_clean_properties(coll, :destroy, 'manifest_text')
+      assert_logged_with_clean_properties(coll, :delete, 'manifest_text')
     end
   end
 
@@ -301,7 +302,7 @@ class LogTest < ActiveSupport::TestCase
         assert_equal(txt, props['new_attributes']['manifest_text'])
       end
       coll.destroy
-      assert_logged(coll, :destroy) do |props|
+      assert_logged(coll, :delete) do |props|
         assert_equal(txt, props['old_attributes']['manifest_text'])
       end
     end