Michael Hartl の Ruby on Rails Tutorial の第 9 章まで到達し、rspec テストに失敗しました。この章を何度も読みましたが、どこが間違っていたのかわかりません。助けてください!また、私は生後 2 週間のプログラマーなので、デバッグの手順を詳しく教えていただければ、とても助かります。
私の git リポジトリはhttps://github.com/kerrieyee/sample_appにあり、rspec の結果は次のとおりです。
Macintosh-143:sample_app jeffreyyee$ bundle exec rspec spec/
..................................................................FF........FFFF.........
Failures:
1) User pages index delete links as an admin user
Failure/Error: it { should have_link('delete', href: user_path(User.first)) }
expected link "delete" to return something
# ./spec/requests/user_pages_spec.rb:45:in `block (5 levels) in <top (required)>'
2) User pages index delete links as an admin user should be able to delete another user
Failure/Error: expect { click_link('delete') }.to change(User, :count).by(-1)
Capybara::ElementNotFound:
no link with title, id or text 'delete' found
# (eval):2:in `click_link'
# ./spec/requests/user_pages_spec.rb:47:in `block (6 levels) in <top (required)>'
# ./spec/requests/user_pages_spec.rb:47:in `block (5 levels) in <top (required)>'
3) User pages signup with valid information should create a user
Failure/Error: fill_in "Confirmation", with: "foobar"
Capybara::ElementNotFound:
cannot fill in, no text field, text area or password field with id, name, or label 'Confirmation' found
# (eval):2:in `fill_in'
# ./spec/requests/user_pages_spec.rb:96:in `block (4 levels) in <top (required)>'
4) User pages signup with valid information after saving the user
Failure/Error: fill_in "Confirmation", with: "foobar"
Capybara::ElementNotFound:
cannot fill in, no text field, text area or password field with id, name, or label 'Confirmation' found
# (eval):2:in `fill_in'
# ./spec/requests/user_pages_spec.rb:96:in `block (4 levels) in <top (required)>'
5) User pages signup with valid information after saving the user
Failure/Error: fill_in "Confirmation", with: "foobar"
Capybara::ElementNotFound:
cannot fill in, no text field, text area or password field with id, name, or label 'Confirmation' found
# (eval):2:in `fill_in'
# ./spec/requests/user_pages_spec.rb:96:in `block (4 levels) in <top (required)>'
6) User pages signup with valid information after saving the user
Failure/Error: fill_in "Confirmation", with: "foobar"
Capybara::ElementNotFound:
cannot fill in, no text field, text area or password field with id, name, or label 'Confirmation' found
# (eval):2:in `fill_in'
# ./spec/requests/user_pages_spec.rb:96:in `block (4 levels) in <top (required)>'
Finished in 4.83 seconds
89 examples, 6 failures
Failed examples:
rspec ./spec/requests/user_pages_spec.rb:45 # User pages index delete links as an admin user
rspec ./spec/requests/user_pages_spec.rb:46 # User pages index delete links as an admin user should be able to delete another user
rspec ./spec/requests/user_pages_spec.rb:99 # User pages signup with valid information should create a user
rspec ./spec/requests/user_pages_spec.rb:108 # User pages signup with valid information after saving the user
rspec ./spec/requests/user_pages_spec.rb:109 # User pages signup with valid information after saving the user
rspec ./spec/requests/user_pages_spec.rb:110 # User pages signup with valid information after saving the user