spec/factories/user_factories.rb in storytime-0.0.1 vs spec/factories/user_factories.rb in storytime-0.0.2
- old
+ new
@@ -1,18 +1,19 @@
FactoryGirl.define do
- factory :user, class: Storytime::User do
+ factory :user do
sequence(:email) { |i| "user#{i}@example.com" }
password "password"
+ sequence(:storytime_name) { |i| "user name #{i}" }
- factory :writer, class: Storytime::User do
- before(:create){|user| user.role = Storytime::Role.find_by(name: "writer") }
+ factory :writer do
+ before(:create){|user| user.storytime_role = Storytime::Role.find_by(name: "writer") }
end
- factory :editor, class: Storytime::User do
- before(:create){|user| user.role = Storytime::Role.find_by(name: "editor") }
+ factory :editor do
+ before(:create){|user| user.storytime_role = Storytime::Role.find_by(name: "editor") }
end
- factory :admin, class: Storytime::User do
- before(:create){|user| user.role = Storytime::Role.find_by(name: "admin") }
+ factory :admin do
+ before(:create){|user| user.storytime_role = Storytime::Role.find_by(name: "admin") }
end
end
end