初期化に複数のパラメーターを持つモデルがあり、そのうちの 1 つはインスタンス化時にモデルのメソッドで使用されます。
def initialize(sha, message, repo)
sha = commit.sha
message = commit.message
associate_with(repo)
end
そして、これらのパラメータを使用して初期化するファクトリを作成しようとしていますが、wrong number of arguments
実行しようとするとエラーが発生します:
FactoryGirl.define do
factory :commit do
intialize_with { new("test_sha", "test_msg", "test_repo") }
end
end
しかし、これは私に与えますwrong number of arguments (0 for 3)
。に複数の引数を渡すことはできませんinitialize_with
か?