Browse Source

JSON stringify tests.

pull/425/head
Sebastian Stehle 7 years ago
parent
commit
3ec10f8639
  1. 10
      tests/Squidex.Domain.Apps.Core.Tests/Operations/HandleRules/RuleEventFormatterTests.cs

10
tests/Squidex.Domain.Apps.Core.Tests/Operations/HandleRules/RuleEventFormatterTests.cs

@ -375,5 +375,15 @@ namespace Squidex.Domain.Apps.Core.Operations.HandleRules
Assert.Equal("{\"actor\":\"client:android\"}", result);
}
[Fact]
public void Should_format_json_with_special_characters()
{
var @event = new EnrichedContentEvent { Actor = new RefToken(RefTokenType.Client, "mobile\"android") };
var result = sut.Format("Script(JSON.stringify({ actor: event.actor.toString() }))", @event);
Assert.Equal("{\"actor\":\"client:mobile\\\"android\"}", result);
}
}
}

Loading…
Cancel
Save