<commit_before>require 'rails_helper'

RSpec.describe Drama, type: :model do
  before(:all) do
    DatabaseCleaner.strategy = :transaction
  end

  before(:each) do
    DatabaseCleaner.start
  end

  after(:each) do
    DatabaseCleaner.clean
  end

  let!(:drama) { FactoryGirl.create(:drama, poster_file_name: 'not_a_real_poster.png') }

  it "fetches a drama" do
    expect(Drama.fetch.count).to eq(1)
  end

  it "returns array of its rating weights" do
    expect(Drama.fetch.count).to eq(1)
  end
end<commit_msg>finished test for all ratings<commit_after>require 'rails_helper'

RSpec.describe Drama, type: :model do
  before(:all) do
    DatabaseCleaner.strategy = :transaction
  end

  before(:each) do
    DatabaseCleaner.start
  end

  after(:each) do
    DatabaseCleaner.clean
  end

  let!(:drama) { FactoryGirl.create(:drama, poster_file_name: 'not_a_real_poster.png') }
  let!(:rating_one) { FactoryGirl.create(:rating, drama: drama) }
  let!(:rating_two) { FactoryGirl.create(:rating, drama: drama, weight: 1) }

  it "fetches a drama" do
    expect(Drama.fetch.count).to eq(1)
  end

  it "returns array of its rating weights" do
    expect(drama.all_ratings).to eq([5, 1])
  end
end
{'fraction_non_alphanumeric': 0.11686143572621036, 'fraction_numerical': 0.005008347245409015, 'mean_word_length': 4.059071729957806, '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': '6855493', 'n_tokens_mistral': 440, 'n_tokens_neox': 415, 'n_words': 102}