rails チュートリアルの10.3.4のリスト 10.49でrails testをしたらエラーになりました。解決方法を教えていただけませんか?
ec2-user:~/environment/sample_app (updating-users) $ rails t Running via Spring preloader in process 4095 Started with run options --seed 13299 ERROR["test_index_including_pagination", UsersIndexTest, 1.1153217339999983] test_index_including_pagination#UsersIndexTest (1.12s) ActionView::Template::Error: ActionView::Template::Error: Missing partial users/_user with {:locale=>[:en], :formats=>[:html], :variants=>[], :handlers=>[:raw, :erb, :html, :builder, :ruby, :coffee, :jbuilder]}. Searched in: * "/home/ec2-user/environment/sample_app/app/views" app/views/users/index.html.erb:8:in `block in _app_views_users_index_html_erb__1851892934246185586_61823200' app/views/users/index.html.erb:7:in `_app_views_users_index_html_erb__1851892934246185586_61823200' test/integration/users_index_test.rb:11:in `block in <class:UsersIndexTest>'
<users_index_test.rb>
require 'test_helper' class UsersIndexTest < ActionDispatch::IntegrationTest def setup @user = users(:michael) end test "index including pagination" do log_in_as(@user) get users_path assert_template 'users/index' assert_select 'div.pagination' User.paginate(page: 1).each do |user| assert_select 'a[href=?]', user_path(user), text: user.name end end end
<index.html.erb>
<% provide(:title, 'All users') %> <h1>All users</h1> <%= will_paginate %> <ul class="users"> <% @users.each do |user| %> <%= render user %> <% end %> </ul> <%= will_paginate %>
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2018/10/01 04:21
2018/10/01 04:23