public async Task <IActionResult> AboutEmployer(AboutEmployerEditModel m)
        {
            var response = await _orchestrator.PostAboutEmployerEditModelAsync(m, User.ToVacancyUser());

            if (!response.Success)
            {
                response.AddErrorsToModelState(ModelState);
            }
            var vm = await _orchestrator.GetAboutEmployerViewModelAsync(m);

            if (!ModelState.IsValid)
            {
                return(View(vm));
            }

            if (_feature.IsFeatureEnabled(FeatureNames.EmployerTaskList))
            {
                if (!vm.IsTaskListCompleted)
                {
                    return(RedirectToRoute(RouteNames.EmployerContactDetails_Get));
                }
                return(RedirectToRoute(RouteNames.EmployerCheckYourAnswersGet));
            }

            return(RedirectToRoute(RouteNames.Vacancy_Preview_Get));
        }
Ejemplo n.º 2
0
        public async Task <IActionResult> AboutEmployer(AboutEmployerEditModel m)
        {
            var response = await _orchestrator.PostAboutEmployerEditModelAsync(m, User.ToVacancyUser());

            if (!response.Success)
            {
                response.AddErrorsToModelState(ModelState);
            }

            if (!ModelState.IsValid)
            {
                var vm = await _orchestrator.GetAboutEmployerViewModelAsync(m);

                return(View(vm));
            }

            return(RedirectToRoute(RouteNames.Vacancy_Preview_Get));
        }
        public async Task WhenUpdated_ShouldFlagFieldIndicators(string employerDescription, string employerWebSiteUrl, string[] setFieldIdentifers, string [] unsetFieldIdentifiers)
        {
            _fixture
            .WithEmployerDescription("has a value")
            .WithEmployerWebsiteUrl("has a value")
            .Setup();

            var aboutEmployerEditModel = new AboutEmployerEditModel
            {
                EmployerAccountId   = _fixture.Vacancy.EmployerAccountId,
                VacancyId           = _fixture.Vacancy.Id,
                EmployerDescription = employerDescription,
                EmployerWebsiteUrl  = employerWebSiteUrl
            };

            await _fixture.PostAboutEmployerEditModelAsync(aboutEmployerEditModel);

            _fixture.VerifyEmployerReviewFieldIndicators(setFieldIdentifers, unsetFieldIdentifiers);
        }
 public async Task PostAboutEmployerEditModelAsync(AboutEmployerEditModel model)
 {
     await Sut.PostAboutEmployerEditModelAsync(model, User);
 }