Fix lang typo in ContentService & fix up the breaking unit test

This commit is contained in:
Warren Buckley
2018-10-31 10:24:40 +00:00
parent 3e3f2a92fd
commit 881ea22efe
2 changed files with 7 additions and 7 deletions

View File

@@ -1202,7 +1202,7 @@ namespace Umbraco.Core.Services.Implement
var langs = string.Join(", ", _languageRepository.GetMany()
.Where(x => culturesChanging.InvariantContains(x.IsoCode))
.Select(x => x.CultureName));
Audit(AuditType.PublishVariant, userId, content.Id, $"Published languagues: {langs}", langs);
Audit(AuditType.PublishVariant, userId, content.Id, $"Published languages: {langs}", langs);
}
else
Audit(AuditType.Publish, userId, content.Id);

View File

@@ -1293,11 +1293,11 @@ namespace Umbraco.Tests.Services
{
// Arrange
var langUk = new Language("en-UK") { IsDefault = true };
var langGB = new Language("en-GB") { IsDefault = true };
var langFr = new Language("fr-FR");
ServiceContext.LocalizationService.Save(langFr);
ServiceContext.LocalizationService.Save(langUk);
ServiceContext.LocalizationService.Save(langGB);
var contentType = MockedContentTypes.CreateBasicContentType();
contentType.Variations = ContentVariation.Culture;
@@ -1309,16 +1309,16 @@ namespace Umbraco.Tests.Services
var published = ServiceContext.ContentService.SavePublishing(content);
//audit log will only show that french was published
var lastLog = ServiceContext.AuditService.GetLogs(content.Id).Last();
Assert.AreEqual($"Published cultures: fr-fr", lastLog.Comment);
Assert.AreEqual($"Published languages: French (France)", lastLog.Comment);
//re-get
content = ServiceContext.ContentService.GetById(content.Id);
content.SetCultureName("content-en", langUk.IsoCode);
content.PublishCulture(langUk.IsoCode);
content.SetCultureName("content-en", langGB.IsoCode);
content.PublishCulture(langGB.IsoCode);
published = ServiceContext.ContentService.SavePublishing(content);
//audit log will only show that english was published
lastLog = ServiceContext.AuditService.GetLogs(content.Id).Last();
Assert.AreEqual($"Published cultures: en-uk", lastLog.Comment);
Assert.AreEqual($"Published languages: English (United Kingdom)", lastLog.Comment);
}
[Test]