File tree 1 file changed +14
-2
lines changed
1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -51,7 +51,6 @@ describe('CoursesService', () => {
51
51
52
52
} ) ;
53
53
54
-
55
54
it ( 'should find a course by id' , ( ) => {
56
55
57
56
coursesService . findCourseById ( 12 )
@@ -74,7 +73,8 @@ describe('CoursesService', () => {
74
73
75
74
it ( 'should save the course data' , ( ) => {
76
75
77
- const changes :Partial < Course > = { titles :{ description : 'Testing Course' } } ;
76
+ const changes :Partial < Course > =
77
+ { titles :{ description : 'Testing Course' } } ;
78
78
79
79
coursesService . saveCourse ( 12 , changes )
80
80
. subscribe ( course => {
@@ -83,6 +83,18 @@ describe('CoursesService', () => {
83
83
84
84
} ) ;
85
85
86
+ const req = httpTestingController . expectOne ( '/api/courses/12' ) ;
87
+
88
+ expect ( req . request . method ) . toEqual ( "PUT" ) ;
89
+
90
+ expect ( req . request . body . titles . description )
91
+ . toEqual ( changes . titles . description ) ;
92
+
93
+ req . flush ( {
94
+ ...COURSES [ 12 ] ,
95
+ ...changes
96
+ } )
97
+
86
98
} ) ;
87
99
88
100
You can’t perform that action at this time.
0 commit comments