<commit_before>require 'rails_helper'

RSpec.describe Comment, type: :model do
  pending "add some examples to (or delete) #{__FILE__}"
end<commit_msg>Add tests for comment model<commit_after>require 'rails_helper'

RSpec.describe Comment, type: :model do
  let(:question) { create(:question) }
  let(:user) {create(:user, username: 'Tyaasdfasdf', email: '<EMAIL>')}
  before do
    allow_any_instance_of(ApplicationController).to receive(:current_user).and_return(user)
  end

  it { should belong_to(:user) }

  it { should belong_to(:response) }

  it 'throws an error if content is nil' do
    comment = Comment.create(content: '')
    expect(comment.errors).to_not be_nil
  end
end
{'fraction_non_alphanumeric': 0.12099125364431487, 'fraction_numerical': 0.0, 'mean_word_length': 5.245454545454545, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, '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': '2200019', 'n_tokens_mistral': 226, 'n_tokens_neox': 217, 'n_words': 60}