FactoryGirl.define do
sequence :email do |n|
"user#{n}@example.com"
end
factory :user do
email {FactoryGirl.generate :email}
password "abc"
admin false
end
end
うまく動作しますが、私がそうする場合
FactoryGirl.define do
sequence :email {|n| "user#{n}@example.com"}
factory :user do
email {FactoryGirl.generate :email}
password "abc"
admin false
end
end
次のエラーが発生します
/Users/brad/.rbenv/versions/1.9.3-p0/lib/ruby/gems/1.9.1/gems/activesupport-3.0.10/lib/active_support/dependencies.rb:235:in `load': /Users/brad/Ruby_Rails/acute_pain/spec/factories.rb:2: syntax error, unexpected '{', expecting keyword_end (SyntaxError)
sequence :email {|n| "user#{n}@example.com"}
^
わぁぁぁぁ?
FactoryGirl3.1.0とRails3.0.10を使用しています。