Comments (4)
・パスワード3文字以下の場合
・パスワードが空の時
・パスワードが一致しなかった場合
のテストはいいのかな。保留にしておく。
何故showとindexのテストはしないのか?
マイページが詳細だった。
from sample_app_for_rspec.
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.
謎だったところ。質問したいところ
users.spec.rb の新規作成画面へのpathが2つある件
users/new
につながるpathは、sign_up
と new_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.
let!の使い方をもっとはっきりさせる(聞いて動いたけどわかってない)
from sample_app_for_rspec.
Related Issues (1)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sample_app_for_rspec.