<commit_before>require 'rails_helper'

RSpec.describe Team, :type => :model do
  it 'has a valid factory' do
    expect(build(:team)).to be_valid
  end

  it 'is invalid without a name' do
    expect(build(:team, name: nil)).to_not be_valid
  end

  it 'is invalid without an owner' do
  	expect(build(:team, owner: nil)).to_not be_valid
  end

  it 'has no projects when created' do
  	new_team = build(:team)
  	expect(new_team.projects).to be_empty
  end

  it 'has managership' do
    new_team = build(:team)
    expect(new_team.managership).not_to be_empty
    expect(new_team.managership).to be == new_team.owner.managership
  end

  it 'has memberships' do
    new_team = build(:team)
    expect(new_team.memberships).not_to be_empty
    expect(new_team.memberships).to be == new_team.owner.memberships
  end
end<commit_msg>Test fixes<commit_after>require 'rails_helper'

RSpec.describe Team, :type => :model do
  it 'has a valid factory' do
    expect(build(:team)).to be_valid
  end

  it 'is invalid without a name' do
    expect(build(:team, name: nil)).to_not be_valid
  end

  it 'is invalid without an owner' do
  	expect(build(:team, owner: nil)).to_not be_valid
  end

  it 'has no projects when created' do
  	new_team = build(:team)
  	expect(new_team.projects).to be_empty
  end

  it 'has managership' do
    new_team = build(:team)
    expect(new_team.managership).not_to be_empty
    expect(new_team.managers).to include(new_team.owner)
    expect(new_team.owner.managed_teams).to include(new_team)
  end

  it 'has memberships' do
    new_team = build(:team)
    expect(new_team.memberships).not_to be_empty
    expect(new_team.owner.teams).to include(new_team)
  end
end
{'fraction_non_alphanumeric': 0.10330578512396695, 'fraction_numerical': 0.0, 'mean_word_length': 3.884726224783862, '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': '3186352', 'n_tokens_mistral': 609, 'n_tokens_neox': 587, 'n_words': 154}