Sha256: 749d79819ca819b99e28d9deed97323641e533088b5b68daf1b222c75210442a

Contents?: true

Size: 503 Bytes

Versions: 62

Compression:

Stored size: 503 Bytes

Contents

require 'test_helper'

module Workarea
  class AuditLogMiddlewareTest < TestCase
    def test_saving_current_modifier
      admin = create_user(admin: true)
      job = {}

      Mongoid::AuditLog.record(admin) do
        AuditLogClientMiddleware.new.call(mock, job, :foo) {}
        assert_equal(admin.id.to_s, job['current_modifier_id'])
      end

      AuditLogServerMiddleware.new.call(mock, job, :foo) do
        assert_equal(admin, Mongoid::AuditLog.current_modifier)
      end
    end
  end
end

Version data entries

62 entries across 62 versions & 1 rubygems

Version Path
workarea-core-3.4.13 test/middleware/workarea/audit_log_middleware_test.rb
workarea-core-3.4.12 test/middleware/workarea/audit_log_middleware_test.rb