DEV: Store details log entries in converter as JSON (#29778)

Plus small DB related fixes
This commit is contained in:
Gerhard Schlager
2024-11-19 23:54:00 +01:00
committed by GitHub
parent 75f4a14568
commit a48af2f120
8 changed files with 42 additions and 21 deletions

View File

@ -140,4 +140,22 @@ RSpec.describe ::Migrations::Database do
expect(described_class.to_blob(nil)).to be_nil
end
end
describe ".to_json" do
it "returns a JSON string for objects" do
expect(described_class.to_json(123)).to eq("123")
expect(described_class.to_json("hello world")).to eq(%q|"hello world"|)
expect(
described_class.to_json(
text: "foo",
number: 123,
date: DateTime.new(2023, 10, 5, 17, 30, 0),
),
).to eq(%q|{"text":"foo","number":123,"date":"2023-10-05T17:30:00.000+00:00"}|)
end
it "returns nil for nil input" do
expect(described_class.to_json(nil)).to be_nil
end
end
end