You have your factory definition in the wrong file, according to your question it is in user.rb. This needs to be in a factories.rb in your test folder (spec) if you use rspec
# user.rb
FactoryGirl.define do
factory :user do |f|
f.email "aabb@hh.de"
f.password "ruby"
f.password_confrimation "ruby"
end
end
Change above to this, (Also you don’t need the f variable)
# spec/factories.rb
FactoryGirl.define do
factory :user do
email "aabb@hh.de"
password "ruby"
password_confrimation "ruby"
end
end
Also as the comments say, make sure gem 'factory_girl_rails' is in your Gemfile, instead of just gem 'factory_girl'