<commit_before># == Schema Information
#
# Table name: users
#
#  id                     :integer          not null, primary key
#  email                  :string           default(""), not null
#  encrypted_password     :string           default(""), not null
#  reset_password_token   :string
#  reset_password_sent_at :datetime
#  remember_created_at    :datetime
#  sign_in_count          :integer          default(0), not null
#  current_sign_in_at     :datetime
#  last_sign_in_at        :datetime
#  current_sign_in_ip     :inet
#  last_sign_in_ip        :inet
#  created_at             :datetime
#  updated_at             :datetime
#

require 'rails_helper'

RSpec.describe User, type: :model do
  it { expect(subject).to have_db_column(:id) }
  it { expect(subject).to have_db_column(:email) }
  it { expect(subject).to have_db_column(:encrypted_password) }
  it { expect(subject).to have_db_column(:reset_password_token) }
  it { expect(subject).to have_db_column(:reset_password_sent_at) }
  it { expect(subject).to have_db_column(:remember_created_at) }
  it { expect(subject).to have_db_column(:sign_in_count) }
  it { expect(subject).to have_db_column(:current_sign_in_at) }
  it { expect(subject).to have_db_column(:last_sign_in_at) }
  it { expect(subject).to have_db_column(:current_sign_in_ip) }
  it { expect(subject).to have_db_column(:last_sign_in_ip) }
  it { expect(subject).to have_db_column(:created_at) }
  it { expect(subject).to have_db_column(:updated_at) }

  it { expect(subject).to have_one(:person) }
end<commit_msg>implement unit test from followed and liked technologies, followed and liked project on user<commit_after># == Schema Information
#
# Table name: users
#
#  id                     :integer          not null, primary key
#  email                  :string           default(""), not null
#  encrypted_password     :string           default(""), not null
#  reset_password_token   :string
#  reset_password_sent_at :datetime
#  remember_created_at    :datetime
#  sign_in_count          :integer          default(0), not null
#  current_sign_in_at     :datetime
#  last_sign_in_at        :datetime
#  current_sign_in_ip     :inet
#  last_sign_in_ip        :inet
#  created_at             :datetime
#  updated_at             :datetime
#

require 'rails_helper'

RSpec.describe User, type: :model do
  it { expect(subject).to have_db_column(:id) }
  it { expect(subject).to have_db_column(:email) }
  it { expect(subject).to have_db_column(:encrypted_password) }
  it { expect(subject).to have_db_column(:reset_password_token) }
  it { expect(subject).to have_db_column(:reset_password_sent_at) }
  it { expect(subject).to have_db_column(:remember_created_at) }
  it { expect(subject).to have_db_column(:sign_in_count) }
  it { expect(subject).to have_db_column(:current_sign_in_at) }
  it { expect(subject).to have_db_column(:last_sign_in_at) }
  it { expect(subject).to have_db_column(:current_sign_in_ip) }
  it { expect(subject).to have_db_column(:last_sign_in_ip) }
  it { expect(subject).to have_db_column(:created_at) }
  it { expect(subject).to have_db_column(:updated_at) }

  it { expect(subject).to have_one(:person) }
  it { expect(subject).to have_and_belong_to_many(:followed_technologies) }
  it { expect(subject).to have_and_belong_to_many(:followed_projects) }
  it { expect(subject).to have_and_belong_to_many(:liked_technologies) }
  it { expect(subject).to have_and_belong_to_many(:liked_projects) }

  describe '#projects' do
    let(:project) { create :project }

    it 'user followed projects' do
      user = create :user

      user.followed_projects << project
      user.save
      user.reload

      expect(user.followed_projects).to eq [project]
    end

    it 'user liked projects' do
      user = create :user

      user.liked_projects << project
      user.save
      user.reload

      expect(user.liked_projects).to eq [project]
    end
  end

  describe '#technologies' do
    let(:technology) { create :technology }

    it 'user followed technologies' do
      user = create :user

      user.followed_technologies << technology
      user.save
      user.reload

      expect(user.followed_technologies).to eq [technology]
    end

    it 'user liked technologies' do
      user = create :user

      user.liked_technologies << technology
      user.save
      user.reload

      expect(user.liked_technologies).to eq [technology]
    end
  end
end
{'fraction_non_alphanumeric': 0.10128581096323032, 'fraction_numerical': 0.00045116174148432213, 'mean_word_length': 3.3727810650887573, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4406612', 'n_tokens_mistral': 1438, 'n_tokens_neox': 1402, 'n_words': 292}