<commit_before>require 'rails_helper'

RSpec.describe Header, :type => :model do
  pending "add some examples to (or delete) #{__FILE__}"
end<commit_msg>wrote three header tests<commit_after>require 'rails_helper'

RSpec.describe Header, :type => :model do
  let(:zoo) { Service.create(name: "Map of Zoos", description: "Description needs to be 12 characters.", organization_id: 1) }
  let(:zoo_v1) {Version.create(service_id: zoo.id, active: true)}

  describe "Initialization" do
    it "Can be created" do
      Header.create(name: "Arbitrary", description: "An arbitrary header", version_id: 1)
      expect(Header.last.name).to eq("Arbitrary")
    end
    it "Fails to save to the database if a version_id is not provided" do
      Header.create(name: "More Arbitrary", description: "Can this get any more generic?")
      expect(Header.exists?(name: "More Arbitrary")).to eq(false)
    end
  end

  describe "Assocations" do
    it "belongs to a version" do
      Header.create(name: "My skull", description: "It's made of bone", version_id: zoo_v1.id )
      expect(zoo_v1.headers.last.name).to eq("My skull")
    end
  end




end
{'fraction_non_alphanumeric': 0.12038664323374342, 'fraction_numerical': 0.006151142355008787, 'mean_word_length': 4.084821428571429, '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': '3190247', 'n_tokens_mistral': 381, 'n_tokens_neox': 360, 'n_words': 118}