jeudi 5 novembre 2015

Trouble with login on laravel test

I am trying to test my laravel application. The issue I am now having is that I am getting a 500 error when trying to login. The test runs

use Laracasts\Integrated\Extensions\Laravel as IntegrationTest;
use Laracests\TestDummy\Factory as TestDummy;
use Illuminate\Foundation\Testing\WithoutMiddleware;
use Illuminate\Foundation\Testing\DatabaseTransactions;
use Illuminate\Foundation\Testing\DatabaseMigrations;

class ExampleTest extends TestCase {


/**
 * A basic functional test example.
 *
 * @return void
 */
public function testBasicExample()
   {

   $this->visit('/')
        ->see('Login')
        ->type('example@example.com', 'email')
        ->type('password', 'password')
        ->press('Login')
        ->seePageIs('/p/watercooler');
   }
}

The error that I am getting is

     There was 1 failure:

1) ExampleTest::testBasicExample
 A GET request to 'http://ift.tt/1KZGRSw' failed. Got a 500 code instead.

 ErrorException on /Library/WebServer/Documents/thirdspace-app/thirdspace/vendor/laravel/framework/src/Illuminate/Foundation/helpers.php line 668

/Library/WebServer/Documents/thirdspace-app/thirdspace/vendor/laracasts/integrated/src/Extensions/Traits/LaravelTestCase.php:148
/Library/WebServer/Documents/thirdspace-app/thirdspace/vendor/laracasts/integrated/src/Extensions/IntegrationTrait.php:441
 /Library/WebServer/Documents/thirdspace-app/thirdspace/vendor/laracasts/integrated/src/Extensions/Traits/LaravelTestCase.php:68
/Library/WebServer/Documents/thirdspace-app/thirdspace/vendor/laracasts/integrated/src/Extensions/Traits/LaravelTestCase.php:88
/Library/WebServer/Documents/thirdspace-app/thirdspace/vendor/laracasts/integrated/src/Extensions/Traits/LaravelTestCase.php:68
/Library/WebServer/Documents/thirdspace-app/thirdspace/vendor/laracasts/integrated/src/Extensions/Traits/LaravelTestCase.php:88
/Library/WebServer/Documents/thirdspace-app/thirdspace/vendor/laracasts/integrated/src/Extensions/Traits/LaravelTestCase.php:68
/Library/WebServer/Documents/thirdspace-app/thirdspace/vendor/laracasts/integrated/src/Extensions/Traits/LaravelTestCase.php:104
/Library/WebServer/Documents/thirdspace-app/thirdspace/vendor/laracasts/integrated/src/Extensions/Traits/LaravelTestCase.php:49
/Library/WebServer/Documents/thirdspace-app/thirdspace/vendor/laracasts/integrated/src/Extensions/IntegrationTrait.php:351
/Library/WebServer/Documents/thirdspace-app/thirdspace/tests/ExampleTest.php:39

Tracking down that line leads to a method in ...foundation/helper.php

if ( ! function_exists('elixir'))
{
/**
* Get the path to a versioned Elixir file.
*
* @param  string  $file
* @return string
*/
function elixir($file)
 {
    static $manifest = null;

    if (is_null($manifest))
    {
*this is the line mentioned in the error*   $manifest = json_decode(file_get_contents(public_path().'/build/rev-manifest.json'), true);
    }

    if (isset($manifest[$file]))
    {
        return '/build/'.$manifest[$file];
    }

    throw new InvalidArgumentException("File {$file} not defined in asset manifest.");
 }
}

So it seems that this has to do with elixir building a new build number for the css file or something? I would ultimately just like to test if this works and skip all this stuff.

I am using laravel 5.0 so "use withoutMiddleware" won't work, if that would even solve this.

Can anyone give me a suggestion how to just run this test in a simple way and see if it works without having to override stuff or write some crazy, ridiculously complex test for this very basic functionality?

Aucun commentaire:

Enregistrer un commentaire