X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/8503c026e63af2f396e82194e4ba24f1b49c1482..ef1d036dce19a8a45605bbaa52bc2a9e5d6bd36a:/services/api/test/unit/log_test.rb?ds=sidebyside diff --git a/services/api/test/unit/log_test.rb b/services/api/test/unit/log_test.rb index 131f8b4b12..66c8c8d923 100644 --- a/services/api/test/unit/log_test.rb +++ b/services/api/test/unit/log_test.rb @@ -228,6 +228,20 @@ class LogTest < ActiveSupport::TestCase assert_logged(auth, :update) end + test "don't log changes only to Collection.preserve_version" do + set_user_from_auth :admin_trustedclient + col = collections(:collection_owned_by_active) + start_log_count = get_logs_about(col).size + assert_equal false, col.preserve_version + col.preserve_version = true + col.save! + assert_equal(start_log_count, get_logs_about(col).size, + "log count changed after updating Collection.preserve_version") + col.name = 'updated by admin' + col.save! + assert_logged(col, :update) + end + test "token isn't included in ApiClientAuthorization logs" do set_user_from_auth :admin_trustedclient auth = ApiClientAuthorization.new @@ -372,7 +386,7 @@ class LogTest < ActiveSupport::TestCase act_as_system_user do Log.create!() end - deadline = Time.now + 1 + deadline = Time.now + 10 while remaining_audit_logs.count == initial_audit_log_count if Time.now > deadline raise "timed out"