0

ビューにホームページと_homepage.html.erbファイルと言うメソッドがあるという点で、製品コントローラーがあります。アサートを取得するためにこのメソッドをテストする方法は、応答の成功を取得する必要があります。test/functional で productcontrllertest.rb を作成し、以下のコードを書きました

require 'test_helper'
class ProductControllerTest < ActionController::TestCase

 test "should get homepage" do
    get :homepage
    assert_response :success
  end

end

そして、「product/homepage」を取得するroutes.rbファイルがあります

コマンド bundle exec rake test:functionals でテストを実行すると、エラーが発生します。

Error is that NoMethodError: undefined method `authenticate' for nil:NilClass

このエラーを修正するのを手伝ってください。

4

1 に答える 1