皆さん、こんにちは。
Rails Tutorial第4版、11章を学習しています。
【リスト 11.3.2: editアクションで有効化】までテストが通るんですが
【リスト 11.34】のテストが通りません。
どなたか分かる方ご教示頂けますか?
以下がテストの結果です。
Running via Spring preloader in process 5627 Started with run options --seed 20968 Run options: --seed 20968--=---=---=---=---=---=---=---=---=---=---=---=---=---=---=---=---=---=---=---=---=---=---=---=---=---=---=---=---=--] 0% Time: 00:00:00, ETA: ??:??:?? # Running: .. 42/3: [========= ] 7% Time: 00:00:00, ETA: 00:00:. 42/4: [=========== ] 9% Time: 00:00:01, ETA: 00:00:1. 42/5: [============== ] 11% Time: 00:00:01, ETA: 00:00:1. 42/6: [================== ] 14% Time: 00:00:01, ETA: 00:00:0ERROR["test_login_with_remembering", Minitest::Result, 1.5397884330013767] test_login_with_remembering#Minitest::Result (1.54s) NoMethodError: NoMethodError: undefined method `remember_token' for nil:NilClass test/integration/users_login_test.rb:45:in `block in <class:UsersLoginTest>' E 42/6: [================== ] 14% Time: 00:00:01, ETA: 00:00:09 Error: UsersLoginTest#test_login_with_remembering: NoMethodError: undefined method `remember_token' for nil:NilClass test/integration/users_login_test.rb:45:in `block in <class:UsersLoginTest>' /usr/local/rvm/gems/ruby-2.4.0/gems/railties-5.1.4/lib/rails/test_unit/reporter.rb:70:in `method': undefined method `test_login_with_remembering' for class `Minitest::Result' (NameError) from /usr/local/rvm/gems/ruby-2.4.0/gems/railties-5.1.4/lib/rails/test_unit/reporter.rb:70:in `format_rerun_snippet' from /usr/local/rvm/gems/ruby-2.4.0/gems/railties-5.1.4/lib/rails/test_unit/reporter.rb:23:in `record' from /usr/local/rvm/gems/ruby-2.4.0/gems/minitest-5.11.3/lib/minitest.rb:803:in `block in record' from /usr/local/rvm/gems/ruby-2.4.0/gems/minitest-5.11.3/lib/minitest.rb:802:in `each' from /usr/local/rvm/gems/ruby-2.4.0/gems/minitest-5.11.3/lib/minitest.rb:802:in `record' from /usr/local/rvm/gems/ruby-2.4.0/gems/minitest-5.11.3/lib/minitest.rb:334:in `run_one_method' from /usr/local/rvm/gems/ruby-2.4.0/gems/minitest-5.11.3/lib/minitest.rb:321:in `block (2 levels) in run' from /usr/local/rvm/gems/ruby-2.4.0/gems/minitest-5.11.3/lib/minitest.rb:320:in `each' from /usr/local/rvm/gems/ruby-2.4.0/gems/minitest-5.11.3/lib/minitest.rb:320:in `block in run' from /usr/local/rvm/gems/ruby-2.4.0/gems/minitest-5.11.3/lib/minitest.rb:360:in `on_signal' from /usr/local/rvm/gems/ruby-2.4.0/gems/minitest-5.11.3/lib/minitest.rb:347:in `with_info_handler' from /usr/local/rvm/gems/ruby-2.4.0/gems/minitest-5.11.3/lib/minitest.rb:319:in `run' from /usr/local/rvm/gems/ruby-2.4.0/gems/railties-5.1.4/lib/rails/test_unit/line_filtering.rb:9:in `run' from /usr/local/rvm/gems/ruby-2.4.0/gems/minitest-5.11.3/lib/minitest.rb:159:in `block in __run' from /usr/local/rvm/gems/ruby-2.4.0/gems/minitest-5.11.3/lib/minitest.rb:159:in `map' from /usr/local/rvm/gems/ruby-2.4.0/gems/minitest-5.11.3/lib/minitest.rb:159:in `__run' from /usr/local/rvm/gems/ruby-2.4.0/gems/minitest-5.11.3/lib/minitest.rb:136:in `run' from /usr/local/rvm/gems/ruby-2.4.0/gems/minitest-5.11.3/lib/minitest.rb:63:in `block in autorun' from /usr/local/rvm/gems/ruby-2.4.0/gems/spring-2.0.2/lib/spring/application.rb:171:in `fork' from /usr/local/rvm/gems/ruby-2.4.0/gems/spring-2.0.2/lib/spring/application.rb:171:in `serve' from /usr/local/rvm/gems/ruby-2.4.0/gems/spring-2.0.2/lib/spring/application.rb:141:in `block in run' from /usr/local/rvm/gems/ruby-2.4.0/gems/spring-2.0.2/lib/spring/application.rb:135:in `loop' from /usr/local/rvm/gems/ruby-2.4.0/gems/spring-2.0.2/lib/spring/application.rb:135:in `run' from /usr/local/rvm/gems/ruby-2.4.0/gems/spring-2.0.2/lib/spring/application/boot.rb:19:in `<top (required)>' from /usr/local/rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:in `require' from /usr/local/rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:in `require' from -e:1:in `<main>'
以下が実行環境です。
Running via Spring preloader in process 5647 About your application's environment Rails version 5.1.4 Ruby version 2.4.0-p0 (x86_64-linux) RubyGems version 2.6.8 Rack version 2.0.5 JavaScript Runtime Node.js (V8) Middleware Rack::Sendfile, ActionDispatch::Static, ActionDispatch::Executor, ActiveSupport::Cache::Strategy::LocalCache::Middleware, Rack::Runtime, Rack::MethodOverride, ActionDispatch::RequestId, ActionDispatch::RemoteIp, Sprockets::Rails::QuietAssets, Rails::Rack::Logger, ActionDispatch::ShowExceptions, WebConsole::Middleware, ActionDispatch::DebugExceptions, ActionDispatch::Reloader, ActionDispatch::Callbacks, ActiveRecord::Migration::CheckPending, ActionDispatch::Cookies, ActionDispatch::Session::CookieStore, ActionDispatch::Flash, Rack::Head, Rack::ConditionalGet, Rack::ETag Environment development Database adapter sqlite3 Database schema version 20180816133348
回答2件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2018/08/17 12:57
2020/01/10 08:38