1
00:00:00,710 --> 00:00:05,870
So we updated our tests, we have great coverage, it seems as though everything is working exactly

2
00:00:05,870 --> 00:00:06,670
as it should.

3
00:00:07,400 --> 00:00:12,740
However, it is always a good idea to go and do an acceptance test to actually get in front of your

4
00:00:12,740 --> 00:00:17,150
browser, try things out and make sure that things work exactly as they should.

5
00:00:17,450 --> 00:00:21,500
And as you'll see, in this case, we actually missed something, something that we didn't cover in

6
00:00:21,500 --> 00:00:25,420
our tests and something that you might have overlooked unless you go and test things.

7
00:00:25,820 --> 00:00:26,750
So let's have a look.

8
00:00:26,780 --> 00:00:29,990
I'm on the site on my local machine, localhost eighty.

9
00:00:30,560 --> 00:00:35,330
I'm going to go to search availability and I'm going to look for dates that I'm pretty sure are available,

10
00:00:35,330 --> 00:00:37,730
say, April the 8th to April the 10th.

11
00:00:38,210 --> 00:00:43,790
And if I search, that works good so far and I click on this and that looks good so far as well.

12
00:00:44,600 --> 00:00:50,060
But you may remember we didn't actually hook up the JavaScript validation for this page, which isn't

13
00:00:50,060 --> 00:00:52,700
a huge deal because we have server side validation.

14
00:00:52,850 --> 00:00:54,910
But that's the part I want to draw to your attention.

15
00:00:54,950 --> 00:00:58,580
I'm going to submit this form without filling anything in at all.

16
00:00:58,940 --> 00:01:03,680
And I want you to watch this top part of the page right here, the reservation details in particular

17
00:01:03,680 --> 00:01:04,250
the room.

18
00:01:04,790 --> 00:01:11,210
So if I leave this blank and submit, it goes to the server, does the server side validation tells

19
00:01:11,210 --> 00:01:13,460
me that there are three missing required fields.

20
00:01:13,490 --> 00:01:14,210
That's great.

21
00:01:14,540 --> 00:01:16,490
But notice the room name disappeared.

22
00:01:16,490 --> 00:01:20,870
And if I keep going here, if I try to submit this again, I'll actually get an error and we need to

23
00:01:20,870 --> 00:01:21,470
fix that.

24
00:01:21,470 --> 00:01:27,470
And the reason we have a problem is because we're not passing enough information to this template in

25
00:01:27,470 --> 00:01:29,840
order to render all of the required information.

26
00:01:29,840 --> 00:01:31,610
In particular, we're not passing the room.

27
00:01:31,620 --> 00:01:33,650
Unfortunately, that's really easy to fix.

28
00:01:34,130 --> 00:01:37,700
So let's go back to our Idy and the handler in question.

29
00:01:37,700 --> 00:01:39,680
Here is the post reservation handler.

30
00:01:40,190 --> 00:01:42,500
So I'm going to scroll down to this part.

31
00:01:42,710 --> 00:01:47,480
And we have the remedy, but we need to pass the room to the template when it renders it.

32
00:01:47,490 --> 00:01:49,220
Unfortunately, that's really easy to do.

33
00:01:49,700 --> 00:01:55,740
We'll just create a new variable called room and potentially an error, and we'll get that from my debug

34
00:01:55,790 --> 00:01:59,480
get room by ID and pass in the remedy that we got right here.

35
00:01:59,990 --> 00:02:01,160
And then to check for an error.

36
00:02:01,160 --> 00:02:07,790
I'll just copy this and pasted here and you can change that message if you want to, but it's invalid

37
00:02:07,790 --> 00:02:09,320
data, so I'll leave it as it is.

38
00:02:09,590 --> 00:02:14,800
And then we just passed the room in which is the variable room we just created.

39
00:02:15,350 --> 00:02:18,890
So now if I stop the application and start it again.

40
00:02:20,960 --> 00:02:26,330
And go back to my Web browser and start right over by going to search availability, choosing again

41
00:02:26,330 --> 00:02:33,110
April the 8th to the 10th and search availability and bring up a room.

42
00:02:33,440 --> 00:02:37,220
And now if I submit this generals' quarter should stay right up here.

43
00:02:37,580 --> 00:02:39,860
So make a reservation and it does.

44
00:02:39,860 --> 00:02:41,450
And that solves that problem.

45
00:02:41,720 --> 00:02:46,730
And of course, you probably want to go in and update your test just to get coverage for that little

46
00:02:46,730 --> 00:02:47,870
bit of code we just added.

47
00:02:47,990 --> 00:02:52,250
But I'll leave that as an exercise for you because you should have no difficulty doing that at this

48
00:02:52,250 --> 00:02:52,550
point.
