2人目のユーザーarcherをtest/fixtures/users.ymlに追加すると2つ目のようなエラーが出てしまいます。サイト自体は動くのですが、なぜこのようなエラーが出てしまうのかが気になります。またこのエラーは今後railsチュートリアルを進めていく上で邪魔になってこないか心配です。どなたかご教授していただけると幸いです。
test/fixtures/users.yml
michael: name: Michael Example email: michael@example.com password_digest: <%= User.digest('password') %> archer: name: Sterling Archer email: duchess@example.gov password_digest: <%= User.digest('password') %>
rails test後の内容 本来ならerrorなく進めることができるところらしい
1) Error: StaticPagesControllerTest#test_should_get_about: ActiveRecord::Fixture::FixtureError: table "users" has no column named "archer". Error: StaticPagesControllerTest#test_should_get_about: NoMethodError: undefined method `each' for nil:NilClass 2) Error: StaticPagesControllerTest#test_should_get_contact: ActiveRecord::Fixture::FixtureError: table "users" has no column named "archer". Error: StaticPagesControllerTest#test_should_get_contact: NoMethodError: undefined method `each' for nil:NilClass 3) Error: StaticPagesControllerTest#test_should_get_home: ActiveRecord::Fixture::FixtureError: table "users" has no column named "archer". Error: StaticPagesControllerTest#test_should_get_home: NoMethodError: undefined method `each' for nil:NilClass 4) Error: StaticPagesControllerTest#test_should_get_help: ActiveRecord::Fixture::FixtureError: table "users" has no column named "archer". Error: StaticPagesControllerTest#test_should_get_help: NoMethodError: undefined method `each' for nil:NilClass 5) Error: UsersSignupTest#test_invalid_signup_information: ActiveRecord::Fixture::FixtureError: table "users" has no column named "archer". Error: UsersSignupTest#test_invalid_signup_information: NoMethodError: undefined method `each' for nil:NilClass 6) Error: UsersSignupTest#test_valid_signup_information: ActiveRecord::Fixture::FixtureError: table "users" has no column named "archer". Error: UsersSignupTest#test_valid_signup_information: NoMethodError: undefined method `each' for nil:NilClass 7) Error: UserTest#test_authenticated?_should_return_false_for_a_user_with_nil_digest: ActiveRecord::Fixture::FixtureError: table "users" has no column named "archer". 8) Error: UserTest#test_email_validation_should_reject_invalid_addresses: ActiveRecord::Fixture::FixtureError: table "users" has no column named "archer". 9) Error: UserTest#test_email_should_be_present: ActiveRecord::Fixture::FixtureError: table "users" has no column named "archer". 10) Error: UserTest#test_name_should_not_be_too_long: ActiveRecord::Fixture::FixtureError: table "users" has no column named "archer". 11) Error: UserTest#test_should_be_valid: ActiveRecord::Fixture::FixtureError: table "users" has no column named "archer". 12) Error: UserTest#test_password_should_have_a_minimum_length: ActiveRecord::Fixture::FixtureError: table "users" has no column named "archer". 13) Error: UserTest#test_name_should_be_present: ActiveRecord::Fixture::FixtureError: table "users" has no column named "archer". 14) Error: UserTest#test_email_should_not_be_too_long: ActiveRecord::Fixture::FixtureError: table "users" has no column named "archer". 15) Error: UserTest#test_password_should_be_present_(nonblank): ActiveRecord::Fixture::FixtureError: table "users" has no column named "archer". 16) Error: UserTest#test_email_addresses_should_be_unique: ActiveRecord::Fixture::FixtureError: table "users" has no column named "archer". 17) Error: UserTest#test_email_validation_should_accept_valid_addresses: ActiveRecord::Fixture::FixtureError: table "users" has no column named "archer". 18) Error: UsersLoginTest#test_login_with_remembering: ActiveRecord::Fixture::FixtureError: table "users" has no column named "archer". Error: UsersLoginTest#test_login_with_remembering: NoMethodError: undefined method `each' for nil:NilClass 19) Error: UsersLoginTest#test_login_with_valid_information: ActiveRecord::Fixture::FixtureError: table "users" has no column named "archer". Error: UsersLoginTest#test_login_with_valid_information: NoMethodError: undefined method `each' for nil:NilClass 20) Error: UsersLoginTest#test_login_with_valid_information_followed_by_logout: ActiveRecord::Fixture::FixtureError: table "users" has no column named "archer". Error: UsersLoginTest#test_login_with_valid_information_followed_by_logout: NoMethodError: undefined method `each' for nil:NilClass 21) Error: UsersLoginTest#test_login_without_remembering: ActiveRecord::Fixture::FixtureError: table "users" has no column named "archer". Error: UsersLoginTest#test_login_without_remembering: NoMethodError: undefined method `each' for nil:NilClass 22) Error: UsersLoginTest#test_login_with_invalid_information: ActiveRecord::Fixture::FixtureError: table "users" has no column named "archer". Error: UsersLoginTest#test_login_with_invalid_information: NoMethodError: undefined method `each' for nil:NilClass 23) Error: SessionsHelperTest#test_current_user_returns_nil_when_remember_digest_is_wrong: ActiveRecord::Fixture::FixtureError: table "users" has no column named "archer". Error: SessionsHelperTest#test_current_user_returns_nil_when_remember_digest_is_wrong: NoMethodError: undefined method `each' for nil:NilClass 24) Error: SessionsHelperTest#test_current_user_returns_right_user_when_session_is_nil: ActiveRecord::Fixture::FixtureError: table "users" has no column named "archer". Error: SessionsHelperTest#test_current_user_returns_right_user_when_session_is_nil: NoMethodError: undefined method `each' for nil:NilClass 25) Error: SiteLayoutTest#test_layout_links: ActiveRecord::Fixture::FixtureError: table "users" has no column named "archer". Error: SiteLayoutTest#test_layout_links: NoMethodError: undefined method `each' for nil:NilClass 26) Error: UsersEditTest#test_successful_edit: ActiveRecord::Fixture::FixtureError: table "users" has no column named "archer". Error: UsersEditTest#test_successful_edit: NoMethodError: undefined method `each' for nil:NilClass 27) Error: UsersEditTest#test_unsuccessful_edit: ActiveRecord::Fixture::FixtureError: table "users" has no column named "archer". Error: UsersEditTest#test_unsuccessful_edit: NoMethodError: undefined method `each' for nil:NilClass 28) Error: SessionsControllerTest#test_should_get_new: ActiveRecord::Fixture::FixtureError: table "users" has no column named "archer". Error: SessionsControllerTest#test_should_get_new: NoMethodError: undefined method `each' for nil:NilClass 29) Error: UsersControllerTest#test_should_get_new: ActiveRecord::Fixture::FixtureError: table "users" has no column named "archer". Error: UsersControllerTest#test_should_get_new: NoMethodError: undefined method `each' for nil:NilClass 30) Error: UsersControllerTest#test_should_redirect_update_when_not_logged_in: ActiveRecord::Fixture::FixtureError: table "users" has no column named "archer". Error: UsersControllerTest#test_should_redirect_update_when_not_logged_in: NoMethodError: undefined method `each' for nil:NilClass 31) Error: UsersControllerTest#test_should_redirect_edit_when_not_logged_in: ActiveRecord::Fixture::FixtureError: table "users" has no column named "archer". Error: UsersControllerTest#test_should_redirect_edit_when_not_logged_in: NoMethodError: undefined method `each' for nil:NilClass 31 runs, 0 assertions, 0 failures, 31 errors, 0 skips
##やってみたこと
rails db:migrate:resetをしてもともと登録してあった自分の名前、メールアドレスを消した。
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。