add user document model

This commit is contained in:
João Geonizeli
2021-08-04 21:53:58 -03:00
parent 95079e2ae7
commit 30b290514f
11 changed files with 158 additions and 3 deletions

View File

@@ -0,0 +1,27 @@
# frozen_string_literal: true
# == Schema Information
#
# Table name: user_documents
#
# id :bigint not null, primary key
# status :string not null
# created_at :datetime not null
# updated_at :datetime not null
# user_id :bigint not null
#
# Indexes
#
# index_user_documents_on_user_id (user_id)
#
# Foreign Keys
#
# fk_rails_... (user_id => users.id)
#
require "rails_helper"
RSpec.describe(UserDocument, type: :model) do
describe "associations" do
it { is_expected.to(belong_to(:user)) }
end
end

View File

@@ -23,4 +23,8 @@ RSpec.describe(User, type: :model) do
it { is_expected.to(validate_presence_of(:last_name)) }
it { is_expected.to(validate_presence_of(:email)) }
end
describe "associations" do
it { is_expected.to(have_many(:documents)) }
end
end