RSpecを使用してWindowsでRails3アプリケーションをテストしようとしました。テストとファクトリを作成しましたが、コマンドラインでRSpecを実行したときに発生する問題を解決できません。
テストファイルの1つは次のとおりです。require'spec_helper'
describe "SignIns" do
it "can sign in" do
user = FactoryGirl.create(:user)
visit new_user_session_path
fill_in "login", with: user.username
fill_in "password", with: user.password
click_on "sign in"
current_user.username.should == user.username
end
end
そして、これがfactories.rbです:
factory :layout do
name "layout1"
end
factory :club do
sequence(:name) { |i| "Club #{i}" }
contact_name "John Doe"
phone "+358401231234"
email "#{name}@example.com"
association :layout
end
factory :user do
sequence(:username) { |i| "user#{i}" }
password 'password'
email "test@example.com"
club
end
RSpecを実行しようとすると、次のエラーが発生します。
trait not registered: name
#C: in 'object'
#.spec/features/sign_in_spec.rb:11:in 'block (2 levels) in (top(required))
私は何が間違っているのですか?