GithubHelp home page GithubHelp logo

Comments (4)

busitora avatar busitora commented on August 11, 2024

・パスワード3文字以下の場合
・パスワードが空の時
・パスワードが一致しなかった場合
のテストはいいのかな。保留にしておく。

何故showとindexのテストはしないのか?
マイページが詳細だった。

from sample_app_for_rspec.

busitora avatar busitora commented on August 11, 2024

fill_in に入れる時に
user[email]でもEmail でも 動くことを確認。
どうやらラベル内の要素を指定する法が良い模様。
【RSpec/capybara】fill_inが上手く動作しない

fill_inを使う場合は、
fill_in "メールアドレス", with: '[email protected]'
のように、labelタグ内に書かれたテキストを指定しても動くはずです。
むしろ、idで指定するよりも読みやすくなるので、個人的にはこちらの書き方をお勧めします。

→ fill_in も共通化できそうな感じかな?

from sample_app_for_rspec.

busitora avatar busitora commented on August 11, 2024

謎だったところ。質問したいところ

users.spec.rb の新規作成画面へのpathが2つある件

users/newにつながるpathは、sign_upnew_user とあったが、どちらを使えばいいか分からなかった。よりパッと見てわかる後者を使用した。

【解決済み】expectの eq の 使い方

expect(current_path).to eq(users_path)
現在のURLが、ユーザーpathであることを期待する

expect(users_path).to eq(current_path)
ユーザーpathが、現在のURLであることを期待する

どっちがいいのか。結果として、前者を使用した(個人的にわかりやすいと思った)

追記: (中の要素は違うが)

Failure/Error: expect(current_path).to eq(logout_path)

       expected: "/logout"
            got: "/login"

前者だと、ログアウトを期待するがログインですよ。なので、後者が正しいとわかった。

from sample_app_for_rspec.

busitora avatar busitora commented on August 11, 2024

let!の使い方をもっとはっきりさせる(聞いて動いたけどわかってない)

from sample_app_for_rspec.

Related Issues (1)

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.