diff options
author | Brice Sanchez <contact@brice-sanchez.com> | 2016-05-30 00:37:53 -0400 |
---|---|---|
committer | Brice Sanchez <contact@brice-sanchez.com> | 2016-05-30 22:17:42 -0400 |
commit | b0019fd9acdf04292ff402e1b9d8528517ea7a63 (patch) | |
tree | 306fdd3ca18bca2b5fc38cd6916a5653676768ee /spec/factories/user.rb | |
parent | eafbd3f3992dc735cbe8fe8efc8296a5c1dc2b78 (diff) | |
download | refinerycms-blog-b0019fd9acdf04292ff402e1b9d8528517ea7a63.tar.gz refinerycms-blog-b0019fd9acdf04292ff402e1b9d8528517ea7a63.tar.bz2 refinerycms-blog-b0019fd9acdf04292ff402e1b9d8528517ea7a63.zip |
Fix specs
Diffstat (limited to 'spec/factories/user.rb')
-rw-r--r-- | spec/factories/user.rb | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/spec/factories/user.rb b/spec/factories/user.rb new file mode 100644 index 0000000..0112b25 --- /dev/null +++ b/spec/factories/user.rb @@ -0,0 +1,27 @@ +FactoryGirl.define do + factory :authentication_devise_user, :class => Refinery::Authentication::Devise::User do + sequence(:username) { |n| "refinery#{n}" } + sequence(:email) { |n| "refinery#{n}@example.com" } + password "refinerycms" + password_confirmation "refinerycms" + end + + factory :authentication_devise_refinery_user, :parent => :authentication_devise_user do + roles { [ ::Refinery::Authentication::Devise::Role[:refinery] ] } + + after(:create) do |user| + ::Refinery::Plugins.registered.each_with_index do |plugin, index| + user.plugins.create(:name => plugin.name, :position => index) + end + end + end + + factory :authentication_devise_refinery_superuser, :parent => :authentication_devise_refinery_user do + roles { + [ + ::Refinery::Authentication::Devise::Role[:refinery], + ::Refinery::Authentication::Devise::Role[:superuser] + ] + } + end +end
\ No newline at end of file |