summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHombreLaser <sebastian-440@live.com>2023-02-23 18:52:25 -0600
committerHombreLaser <sebastian-440@live.com>2023-02-23 18:52:25 -0600
commit97ba3df5e5970d29064daf56309e73df85a70613 (patch)
treee0848a54f7136596353dd8782a2f1ad8f4780efc
parent931c4ea61c74cbb500895027926dc29398f56f22 (diff)
Añade factory de usuario
-rw-r--r--spec/factories/user_account.rb11
-rw-r--r--spec/rails_helper.rb2
2 files changed, 12 insertions, 1 deletions
diff --git a/spec/factories/user_account.rb b/spec/factories/user_account.rb
new file mode 100644
index 0000000..1691e0c
--- /dev/null
+++ b/spec/factories/user_account.rb
@@ -0,0 +1,11 @@
+# frozen_string_literal: true
+
+FactoryBot.define do
+ factory :user_account, class: 'UserAccount' do
+ email { Faker::Internet.email }
+ first_name { Faker::Name.first_name }
+ last_name { Faker::Name.last_name }
+ password { SecureRandom.hex(32) }
+ role { 'regular' }
+ end
+end
diff --git a/spec/rails_helper.rb b/spec/rails_helper.rb
index 0624d3e..ea338cd 100644
--- a/spec/rails_helper.rb
+++ b/spec/rails_helper.rb
@@ -20,7 +20,7 @@ require 'rspec/rails'
# directory. Alternatively, in the individual `*_spec.rb` files, manually
# require only the support files necessary.
#
-# Dir[Rails.root.join('spec', 'support', '**', '*.rb')].sort.each { |f| require f }
+Dir[Rails.root.join('spec', 'support', '**', '*.rb')].sort.each { |f| require f }
# Checks for pending migrations and applies them before tests are run.
# If you are not using ActiveRecord, you can remove these lines.