features/support/factories.rb in refinerycms-authentication-1.0.8 vs features/support/factories.rb in refinerycms-authentication-1.0.9
- old
+ new
@@ -1,26 +1,32 @@
require 'factory_girl'
-Factory.define :user do |u|
- u.sequence(:username) { |n| "person#{n}" }
- u.sequence(:email) { |n| "person#{n}@cucumber.com" }
- u.password "greenandjuicy"
- u.password_confirmation "greenandjuicy"
+FactoryGirl.define do
+ factory :user do |u|
+ u.sequence(:username) { |n| "person#{n}" }
+ u.sequence(:email) { |n| "person#{n}@cucumber.com" }
+ u.password "greenandjuicy"
+ u.password_confirmation "greenandjuicy"
+ end
end
-Factory.define :refinery_user, :parent => :user do |u|
- u.roles { [ Role[:refinery] ] }
+FactoryGirl.define do
+ factory :refinery_user, :parent => :user do |u|
+ u.roles { [ Role[:refinery] ] }
- u.after_create do |user|
- Refinery::Plugins.registered.each_with_index do |plugin, index|
- user.plugins.create(:name => plugin.name, :position => index)
+ u.after_create do |user|
+ Refinery::Plugins.registered.each_with_index do |plugin, index|
+ user.plugins.create(:name => plugin.name, :position => index)
+ end
end
end
end
-Factory.define :refinery_translator, :parent => :user do |u|
- u.roles { [ Role[:refinery], Role[:translator] ] }
+FactoryGirl.define do
+ factory :refinery_translator, :parent => :user do |u|
+ u.roles { [ Role[:refinery], Role[:translator] ] }
- u.after_create do |user|
- user.plugins.create(:name => 'refinery_pages', :position => 0)
+ u.after_create do |user|
+ user.plugins.create(:name => 'refinery_pages', :position => 0)
+ end
end
end