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.5.15 test/middleware/workarea/audit_log_middleware_test.rb
workarea-core-3.4.36 test/middleware/workarea/audit_log_middleware_test.rb
workarea-core-3.5.14 test/middleware/workarea/audit_log_middleware_test.rb
workarea-core-3.4.35 test/middleware/workarea/audit_log_middleware_test.rb
workarea-core-3.5.13 test/middleware/workarea/audit_log_middleware_test.rb
workarea-core-3.4.34 test/middleware/workarea/audit_log_middleware_test.rb
workarea-core-3.5.12 test/middleware/workarea/audit_log_middleware_test.rb
workarea-core-3.4.33 test/middleware/workarea/audit_log_middleware_test.rb
workarea-core-3.5.11 test/middleware/workarea/audit_log_middleware_test.rb
workarea-core-3.5.10 test/middleware/workarea/audit_log_middleware_test.rb
workarea-core-3.4.32 test/middleware/workarea/audit_log_middleware_test.rb
workarea-core-3.5.9 test/middleware/workarea/audit_log_middleware_test.rb
workarea-core-3.4.31 test/middleware/workarea/audit_log_middleware_test.rb
workarea-core-3.5.8 test/middleware/workarea/audit_log_middleware_test.rb
workarea-core-3.4.30 test/middleware/workarea/audit_log_middleware_test.rb
workarea-core-3.5.7 test/middleware/workarea/audit_log_middleware_test.rb
workarea-core-3.4.29 test/middleware/workarea/audit_log_middleware_test.rb
workarea-core-3.5.6 test/middleware/workarea/audit_log_middleware_test.rb
workarea-core-3.4.28 test/middleware/workarea/audit_log_middleware_test.rb
workarea-core-3.5.5 test/middleware/workarea/audit_log_middleware_test.rb