0

わあ!テーブル名とカラム名の両方でいくつかの移行を行った後、rspec テストの 1 つが失敗し、その原因を追跡するのに苦労しています。したがって、次の行が原因で失敗する rspc テストは次のとおりです。

it { should belong_to(:key_performance_indicators) }

このエラーを生成することにより:

1) KeyPerformanceInterval の失敗/エラー: it { got_to(:key_performance_indicators) } KeyPerformanceInterval には、key_performance_indicators と呼ばれる belongs_to アソシエーションが必要です (KeyPerformanceInterval には、key_performance_indicators_id 外部キーがありません)。

では、どのように遡ればよいのでしょうか。テストで話している私のクラスは次のとおりです。

class KeyPerformanceInterval < ActiveRecord::Base

  include ActiveModel::ForbiddenAttributesProtection

  belongs_to :key_performance_indicators

end

確認するソース コードがさらに必要な場合はお知らせください。質問を更新します。

4

1 に答える 1