aboutsummaryrefslogtreecommitdiffstats
path: root/spec/factories/user.rb
diff options
context:
space:
mode:
authorPhilip Arndt <git@p.arndt.io>2016-05-31 15:03:10 +1200
committerPhilip Arndt <git@p.arndt.io>2016-05-31 15:03:10 +1200
commit8feff5c51669a83a167cf9727f914b2a5e4937e7 (patch)
tree3d196857048582fcb83f1b21a640c14e2508bc72 /spec/factories/user.rb
parentdce7da10f8151a9e1ebc3f2cacfb80d207048313 (diff)
parentfeee12b1037904aed72d44d42d8d27841cb6cda4 (diff)
downloadrefinerycms-blog-8feff5c51669a83a167cf9727f914b2a5e4937e7.tar.gz
refinerycms-blog-8feff5c51669a83a167cf9727f914b2a5e4937e7.tar.bz2
refinerycms-blog-8feff5c51669a83a167cf9727f914b2a5e4937e7.zip
Merge pull request #458 from refinery/bugfix/specs
Bugfix/specs
Diffstat (limited to 'spec/factories/user.rb')
-rw-r--r--spec/factories/user.rb27
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