add user model
This commit is contained in:
26
spec/models/user_spec.rb
Normal file
26
spec/models/user_spec.rb
Normal file
@@ -0,0 +1,26 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
# == Schema Information
|
||||
#
|
||||
# Table name: users
|
||||
#
|
||||
# id :bigint not null, primary key
|
||||
# email :string not null
|
||||
# first_name :string not null
|
||||
# last_name :string not null
|
||||
# created_at :datetime not null
|
||||
# updated_at :datetime not null
|
||||
#
|
||||
# Indexes
|
||||
#
|
||||
# index_users_on_email (email) 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
|
||||
end
|
||||
@@ -67,3 +67,10 @@ RSpec.configure do |config|
|
||||
# arbitrary gems may also be filtered via:
|
||||
# config.filter_gems_from_backtrace("gem name")
|
||||
end
|
||||
|
||||
Shoulda::Matchers.configure do |config|
|
||||
config.integrate do |with|
|
||||
with.test_framework(:rspec)
|
||||
with.library(:rails)
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user