Code Monkey home page Code Monkey logo

your-songs-laravel's People

Contributors

kt-321 avatar

your-songs-laravel's Issues

$response->assertRedirect(route("home"));が上手く機能しません。

概要

  • RegisterTestにおいて、「$response->assertRedirect(route("home"));」の記述が誤っているのか、テスト実行時にエラーが発生してしまいます。

  • LoginTestにおいて、「RuntimeException: Session store not set on request.」とエラーが出ます。

エラー詳細

  • RegisterTestのtest_request_should_pass_when_data_is_providedにおいて、
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
-'http://localhost/home'
+'http://localhost'

と表示されます。
これは、userのidが渡されていないために起こっているエラーでしょうか?
またその場合、ユーザー登録直後の記述において、どのような記述でuserのidを渡すことができるのでしょうか?

  • LoginTestのtest_valid_user_can_loginでは、$this->withoutExceptionHandling();でエラー内容を調べると
// ログイン実行
        $response = $this->post(route("login.post"), [
            "email" => $user->email,
            "password" => "test1111"
        ]);

のパスワードの行に関して、

RuntimeException: Session store not set on request.

と表示されました。
「web」ミドルウェアをrouteに設定したのですが、エラーは解消されませんでした。

こちらは、そもそもテストの記述の仕方自体に問題があるのか、それともミドルウェアの記述やLaravelのバージョン等別の箇所に問題があるのか、いずれの可能性が高いかアドバイスいただけますでしょうか?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.