rails tutorialの6章をやっているのですがrails testを行うと
Error: UsersControllerTest#test_should_get_new: NoMethodError: undefined method `each' for nil:NilClass StaticPagesControllerTest#test_should_get_about: NoMethodError: undefined method `each' for nil:NilClass
という二つのエラーが出てしまいます。
どの様に解決すればよいでしょうか?
users_controller_test.rb
require 'test_helper' class UsersControllerTest < ActionDispatch::IntegrationTest test "should get new" do get signup_path assert_response :success end end
sample_pages_controller_test.rb
require 'test_helper' class StaticPagesControllerTest < ActionDispatch::IntegrationTest def setup @base_title= "Ruby on Rails Tutorial Sample App" end test "should get home" do get root_path assert_response :success assert_select "title", "Ruby on Rails Tutorial Sample App" end test "should get help" do get help_path assert_response :success assert_select "title", "Help | #{@base_title}" end test "should get about" do get about_path assert_response :success assert_select "title", "About | #{@base_title}" end test "should get contact" do get contact_path assert_response :success assert_select "title", "Contact | #{@base_title}" end end
まだ回答がついていません
会員登録して回答してみよう