39 lines
1.2 KiB
Ruby
39 lines
1.2 KiB
Ruby
# frozen_string_literal: true
|
|
|
|
# == Schema Information
|
|
#
|
|
# Table name: users
|
|
#
|
|
# id :bigint not null, primary key
|
|
# email :string default(""), not null
|
|
# encrypted_password :string default(""), not null
|
|
# first_name :string not null
|
|
# last_name :string not null
|
|
# remember_created_at :datetime
|
|
# reset_password_sent_at :datetime
|
|
# reset_password_token :string
|
|
# wallet_address :string
|
|
# created_at :datetime not null
|
|
# updated_at :datetime not null
|
|
#
|
|
# Indexes
|
|
#
|
|
# index_users_on_email (email) UNIQUE
|
|
# index_users_on_reset_password_token (reset_password_token) UNIQUE
|
|
#
|
|
require "rails_helper"
|
|
|
|
RSpec.describe(User, type: :model) do
|
|
describe "validations" do
|
|
it { is_expected.to(validate_presence_of(:first_name)) }
|
|
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)) }
|
|
it { is_expected.to(have_many(:stake_orders)) }
|
|
it { is_expected.to(have_one(:fiat_balance)) }
|
|
end
|
|
end
|