File tree Expand file tree Collapse file tree 2 files changed +11
-10
lines changed
DigitalLearningSolutions.Web.Tests/Controllers/TrackingSystem/Delegates
DigitalLearningSolutions.Web/Controllers/TrackingSystem/Delegates Expand file tree Collapse file tree 2 files changed +11
-10
lines changed Original file line number Diff line number Diff line change 11namespace DigitalLearningSolutions . Web . Tests . Controllers . TrackingSystem . Delegates
22{
3- using System ;
4- using System . Collections . Generic ;
53 using DigitalLearningSolutions . Data . Models ;
64 using DigitalLearningSolutions . Data . Models . Courses ;
75 using DigitalLearningSolutions . Data . Models . CustomPrompts ;
1513 using DigitalLearningSolutions . Web . ViewModels . TrackingSystem . Delegates . DelegateProgress ;
1614 using FakeItEasy ;
1715 using FluentAssertions . AspNetCore . Mvc ;
16+ using Microsoft . AspNetCore . Mvc ;
1817 using Microsoft . Extensions . Configuration ;
1918 using NUnit . Framework ;
19+ using System ;
20+ using System . Collections . Generic ;
2021
2122 public class DelegateProgressControllerTests
2223 {
@@ -386,7 +387,11 @@ public void Delegate_removal_for_delegate_with_no_active_progress_returns_not_fo
386387 ) ;
387388
388389 // Then
389- result . Should ( ) . BeNotFoundResult ( ) ;
390+ result . Should ( )
391+ . BeRedirectToActionResult ( )
392+ . WithActionName ( "StatusCode" )
393+ . WithControllerName ( "LearningSolutions" )
394+ . WithRouteValue ( "code" , 410 ) ;
390395 }
391396
392397 [ Test ]
Original file line number Diff line number Diff line change @@ -275,10 +275,8 @@ public IActionResult ConfirmRemoveFromCourse(
275275 )
276276 {
277277 var progress = progressService . GetDetailedCourseProgress ( progressId ) ;
278- if ( progress == null )
279- {
280- return StatusCode ( ( int ) HttpStatusCode . Gone ) ;
281- }
278+ if ( ! courseService . DelegateHasCurrentProgress ( progressId ) || progress == null )
279+ return RedirectToAction ( "StatusCode" , "LearningSolutions" , new { code = 410 } ) ;
282280
283281 var model = new RemoveFromCourseViewModel (
284282 progress ,
@@ -305,9 +303,7 @@ RemoveFromCourseViewModel model
305303
306304 var progress = progressService . GetDetailedCourseProgress ( progressId ) ;
307305 if ( ! courseService . DelegateHasCurrentProgress ( progressId ) || progress == null )
308- {
309- return new NotFoundResult ( ) ;
310- }
306+ return RedirectToAction ( "StatusCode" , "LearningSolutions" , new { code = 410 } ) ;
311307
312308 courseService . RemoveDelegateFromCourse (
313309 progress . DelegateId ,
You can’t perform that action at this time.
0 commit comments