<commit_before>require 'spec_helper'

describe Workplace do
  before(:each) do
    @wp = create(:workplace)
  end

  context "validates" do
    it { should validate_presence_of(:designation) }
    it { should validate_uniqueness_of(:designation) }
    it { should ensure_length_of(:designation).is_at_least(5).is_at_most(50) }
    #it { should validate_presence_of(:description) }
  end

  context "associations" do
    it "has_many :bproce_workplaces" do
      should have_many(:bproce_workplaces) #рабочее место относится ко многим процессам
    end
    it "has_many :bproces, :through => :bproce_workplaces" do
      should have_many(:bproces).through(:bproce_workplaces)
    end
    it "has_many :user_workplace" do
      should have_many(:user_workplace) # на рабочем месте может быть много исполнителей
    end
    it "has_many :user_workplace, :through => :user_workplace" do
      should have_many(:users).through(:user_workplace)
    end
  end

end
<commit_msg>upd: rspec tests<commit_after>require 'spec_helper'

describe Workplace do

  context "validates" do
    it { should validate_presence_of(:designation) }
    it { should validate_uniqueness_of(:designation) }
    it { should ensure_length_of(:designation).is_at_least(5).is_at_most(50) }
  end

  context "associations" do
    it { should have_many(:bproce_workplaces) }
    it { should have_many(:bproces).through(:bproce_workplaces) }
    it { should have_many(:user_workplace) }
    it { should have_many(:users).through(:user_workplace) }
  end

end

{'fraction_non_alphanumeric': 0.09645669291338582, 'fraction_numerical': 0.003937007874015748, 'mean_word_length': 4.446428571428571, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '6248877', 'n_tokens_mistral': 534, 'n_tokens_neox': 530, 'n_words': 113}