improve test setup with factory bot

This commit is contained in:
João Geonizeli
2021-08-14 11:58:51 -03:00
parent 51a493b327
commit 97c6f28b03
10 changed files with 176 additions and 16 deletions

View File

@@ -0,0 +1,26 @@
# frozen_string_literal: true
# == Schema Information
#
# Table name: admin_users
#
# id :bigint not null, primary key
# email :string default(""), not null
# encrypted_password :string default(""), not null
# remember_created_at :datetime
# reset_password_sent_at :datetime
# reset_password_token :string
# created_at :datetime not null
# updated_at :datetime not null
#
# Indexes
#
# index_admin_users_on_email (email) UNIQUE
# index_admin_users_on_reset_password_token (reset_password_token) UNIQUE
#
FactoryBot.define do
factory :admin_user do
sequence(:email) { |n| "admin-#{n}@example.com" }
password { "password" }
end
end