nothingworksinc / ticketbeast

Back to the lesson videos:
https://course.testdrivenlaravel.com/lessons
552 stars 11 forks source link

Part 1.3: http status code [500] error not covered by course content #1

Closed amite closed 8 years ago

amite commented 8 years ago

When I reached the view layer, I started getting this error:

ViewConcertListingTest::user_can_view_a_concert_listing
A request to [http://localhost/concerts/1] failed. Received status code [500].

That's because the server wasn't running. I had to setup ticketbeast on homestead and then got the test moving ahead.

drbyte commented 8 years ago

The error is shown at 9:03 on https://course.testdrivenlaravel.com/lessons/module-1/getting-to-green

There was no need to use homestead merely for the test, because earlier in the setup (at 3:55) the database was set to in-memory sqlite (see the phpunit.xml edits).

dave-alvarez commented 8 years ago

Not to mention you're not going to get a status code of 500 (internal server error) if the server is not running.

vitr commented 8 years ago

Laravel must use built-in php web server, you don't need to install homestead or able to visit http://localhost/concerts/1 in a browser. But who actually runs the server during testing? I believe phpunit does it for the time of test execution.

amite commented 8 years ago

Yes. You guys are all right. I tried it out and it worked without the server