Welcome to mirror list, hosted at ThFree Co, Russian Federation.

json_formatter_spec.rb « omniauth_logging « gitlab « lib « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: f65b247d5d713a2f3a64161f88fe182232ba3fff (plain)
1
2
3
4
5
6
7
8
9
10
11
12
# frozen_string_literal: true

require 'spec_helper'

RSpec.describe Gitlab::OmniauthLogging::JSONFormatter do
  it "generates log in json format" do
    Timecop.freeze(Time.utc(2019, 12, 04, 9, 10, 11, 123456)) do
      expect(subject.call(:info, Time.now, 'omniauth', 'log message'))
        .to eq %Q({"severity":"info","timestamp":"2019-12-04T09:10:11.123Z","pid":#{Process.pid},"progname":"omniauth","message":"log message"}\n)
    end
  end
end