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));
        }
Example #3
0
        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);
        }
Example #4
0
        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();
        }
Example #5
0
 public async Task PostVacancyDescriptionEditModelAsync(VacancyDescriptionEditModel model)
 {
     await Sut.PostVacancyDescriptionEditModelAsync(model, User);
 }