add user document model
This commit is contained in:
27
spec/models/user_document_spec.rb
Normal file
27
spec/models/user_document_spec.rb
Normal 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
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user