deviseを使用したカスタムサインアップフォーム用の非常にシンプルなカピバラスクリプトがあります。
scenario "allow me to register and should take me to the new partner page" do
visit '/registrations/become_partner'
response.should be_success
end
テストを実行しようとすると、次のエラーが発生します。
ActionView::Template::Error:
undefined method `first_name' for #<User:0x00000004d259e8>
このメソッドが定義されていても。モデルにattr_accesible
セットがあり、ページがレンダリングされ、レールコンソールからこのメソッドを呼び出すことができます。他の場所で問題がないのに、なぜカピバラがこのエラーをスローするのですか?