我已经定义了一个名为 admin_user 的工厂,但是当我尝试使用它时出现错误:
工厂/user_factory.rb:
FactoryGirl.define do
factory :user do
email "example_user@example"
password "password"
end
factory :admin_user do
email "admin_user@example.com"
password "admin_password"
end
end
authentication_steps.rb:
Given /^I have a valid admin account$/ do
@user = FactoryGirl.create(:admin_user)
end
运行该步骤时出现以下错误:
uninitialized constant AdminUser (NameError)
是否有一些我没有正确遵循的语法?
谢谢