<commit_before># encoding: utf-8
require 'rails_helper'

describe Comment do
  before(:each) do
    @comment = FactoryGirl.create(:comment1)
  end

  subject { @comment }

  describe "模型校验" do
    it { should validate_presence_of(:user_id) }
    it { should validate_presence_of(:blog_id) }
  end
end<commit_msg>Refactor model/comment spec. :smiley:<commit_after># encoding: utf-8
require 'rails_helper'

describe Comment do
  it { should belong_to(:user) }
  it { should belong_to(:blog) }

  it { should validate_presence_of(:user_id) }
  it { should validate_presence_of(:blog_id) }
  it { should validate_presence_of(:nickname) }
  it { should validate_presence_of(:email) }
  it { should validate_presence_of(:content) }

  it { should validate_length_of(:nickname).is_at_least(1).is_at_most(8) }
  it { should validate_length_of(:content).is_at_least(1).is_at_most(160) }
end
{'fraction_non_alphanumeric': 0.11464245175936436, 'fraction_numerical': 0.01021566401816118, 'mean_word_length': 5.125, 'pattern_counts': {'":': 0, '<': 3, '<?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': '2856141', 'n_tokens_mistral': 322, 'n_tokens_neox': 310, 'n_words': 64}