So we updated our tests, we have great coverage, it seems as though everything is working exactly
as it should.
However, it is always a good idea to go and do an acceptance test to actually get in front of your
browser, try things out and make sure that things work exactly as they should.
And as you'll see, in this case, we actually missed something, something that we didn't cover in
our tests and something that you might have overlooked unless you go and test things.
So let's have a look.
I'm on the site on my local machine, localhost eighty.
I'm going to go to search availability and I'm going to look for dates that I'm pretty sure are available,
say, April the 8th to April the 10th.
And if I search, that works good so far and I click on this and that looks good so far as well.
But you may remember we didn't actually hook up the JavaScript validation for this page, which isn't
a huge deal because we have server side validation.
But that's the part I want to draw to your attention.
I'm going to submit this form without filling anything in at all.
And I want you to watch this top part of the page right here, the reservation details in particular
the room.
So if I leave this blank and submit, it goes to the server, does the server side validation tells
me that there are three missing required fields.
That's great.
But notice the room name disappeared.
And if I keep going here, if I try to submit this again, I'll actually get an error and we need to
fix that.
And the reason we have a problem is because we're not passing enough information to this template in
order to render all of the required information.
In particular, we're not passing the room.
Unfortunately, that's really easy to fix.
So let's go back to our Idy and the handler in question.
Here is the post reservation handler.
So I'm going to scroll down to this part.
And we have the remedy, but we need to pass the room to the template when it renders it.
Unfortunately, that's really easy to do.
We'll just create a new variable called room and potentially an error, and we'll get that from my debug
get room by ID and pass in the remedy that we got right here.
And then to check for an error.
I'll just copy this and pasted here and you can change that message if you want to, but it's invalid
data, so I'll leave it as it is.
And then we just passed the room in which is the variable room we just created.
So now if I stop the application and start it again.
And go back to my Web browser and start right over by going to search availability, choosing again
April the 8th to the 10th and search availability and bring up a room.
And now if I submit this generals' quarter should stay right up here.
So make a reservation and it does.
And that solves that problem.
And of course, you probably want to go in and update your test just to get coverage for that little
bit of code we just added.
But I'll leave that as an exercise for you because you should have no difficulty doing that at this
point.