public async Task <IActionResult> VacancyDescription(VacancyDescriptionEditModel m) { var response = await _orchestrator.PostVacancyDescriptionEditModelAsync(m, User.ToVacancyUser()); if (!response.Success) { response.AddErrorsToModelState(ModelState); } var vm = await _orchestrator.GetVacancyDescriptionViewModelAsync(m); if (!ModelState.IsValid) { return(View(vm)); } if (_feature.IsFeatureEnabled(FeatureNames.EmployerTaskList)) { if (vm.IsTaskListCompleted) { return(RedirectToRoute(RouteNames.EmployerCheckYourAnswersGet)); } return(RedirectToRoute(RouteNames.EmployerTaskListGet)); } return(RedirectToRoute(RouteNames.Vacancy_Preview_Get)); }
public async Task <IActionResult> VacancyDescription(VacancyDescriptionEditModel m) { var response = await _orchestrator.PostVacancyDescriptionEditModelAsync(m, User.ToVacancyUser()); if (!response.Success) { response.AddErrorsToModelState(ModelState); } if (!ModelState.IsValid) { var vm = await _orchestrator.GetVacancyDescriptionViewModelAsync(m); return(View(vm)); } return(RedirectToRoute(RouteNames.Vacancy_Preview_Get)); }
public async Task WhenShortDescriptionIsUpdated_ShouldFlagFieldIndicators(string description, string trainingDescription, string outcomeDescription, string[] setFieldIndicators, string[] unsetFieldIndicators) { _fixture .WithDescription("has a value") .WithTrainingDescription("has a value") .WithOutcomeDescription("has a value") .Setup(); var vacancyDescriptionEditModel = new VacancyDescriptionEditModel { Ukprn = _fixture.Vacancy.TrainingProvider.Ukprn.Value, VacancyId = _fixture.Vacancy.Id, VacancyDescription = description, TrainingDescription = trainingDescription, OutcomeDescription = outcomeDescription }; await _fixture.PostVacancyDescriptionEditModelAsync(vacancyDescriptionEditModel); _fixture.VerifyProviderReviewFieldIndicators(setFieldIndicators, unsetFieldIndicators); }
public async Task WhenUpdated__ShouldCallUpdateDraftVacancy(string description, string trainingDescription, string outcomeDescription) { _fixture .WithDescription("has a value") .WithTrainingDescription("has a value") .WithOutcomeDescription("has a value") .Setup(); var vacancyDescriptionEditModel = new VacancyDescriptionEditModel { Ukprn = _fixture.Vacancy.TrainingProvider.Ukprn.Value, VacancyId = _fixture.Vacancy.Id, VacancyDescription = description, TrainingDescription = trainingDescription, OutcomeDescription = outcomeDescription }; await _fixture.PostVacancyDescriptionEditModelAsync(vacancyDescriptionEditModel); _fixture.VerifyUpdateDraftVacancyAsyncIsCalled(); }
public async Task PostVacancyDescriptionEditModelAsync(VacancyDescriptionEditModel model) { await Sut.PostVacancyDescriptionEditModelAsync(model, User); }