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.27 test/middleware/workarea/audit_log_middleware_test.rb
workarea-core-3.5.26 test/middleware/workarea/audit_log_middleware_test.rb
workarea-core-3.4.45 test/middleware/workarea/audit_log_middleware_test.rb
workarea-core-3.5.25 test/middleware/workarea/audit_log_middleware_test.rb
workarea-core-3.5.23 test/middleware/workarea/audit_log_middleware_test.rb
workarea-core-3.4.44 test/middleware/workarea/audit_log_middleware_test.rb
workarea-core-3.5.22 test/middleware/workarea/audit_log_middleware_test.rb
workarea-core-3.4.43 test/middleware/workarea/audit_log_middleware_test.rb
workarea-core-3.5.21 test/middleware/workarea/audit_log_middleware_test.rb
workarea-core-3.4.42 test/middleware/workarea/audit_log_middleware_test.rb
workarea-core-3.5.20 test/middleware/workarea/audit_log_middleware_test.rb
workarea-core-3.4.41 test/middleware/workarea/audit_log_middleware_test.rb
workarea-core-3.5.19 test/middleware/workarea/audit_log_middleware_test.rb
workarea-core-3.4.40 test/middleware/workarea/audit_log_middleware_test.rb
workarea-core-3.5.18 test/middleware/workarea/audit_log_middleware_test.rb
workarea-core-3.4.39 test/middleware/workarea/audit_log_middleware_test.rb
workarea-core-3.5.17 test/middleware/workarea/audit_log_middleware_test.rb
workarea-core-3.4.38 test/middleware/workarea/audit_log_middleware_test.rb
workarea-core-3.5.16 test/middleware/workarea/audit_log_middleware_test.rb
workarea-core-3.4.37 test/middleware/workarea/audit_log_middleware_test.rb