<commit_before>require 'test_helper'

describe IndividualAccountPolicy do
  let(:existing_user) { create(:user, with_individual_account: true) }
  let(:existing_token) { StubToken.new(nil, nil, existing_user.id) }
  let(:new_user) { create(:user, with_individual_account: false) }
  let(:new_token) { StubToken.new(nil, nil, new_user.id) }
  let(:account) { build_stubbed(:account) }

  describe '#create?' do
    it 'returns true for user without individual account' do
      IndividualAccountPolicy.new(new_token, account).must_allow :create?
    end
    it 'returns false for user with individual account' do
      IndividualAccountPolicy.new(existing_token, account).wont_allow :create?
    end
  end
end<commit_msg>Test individual account for ia policy<commit_after>require 'test_helper'

describe IndividualAccountPolicy do
  let(:existing_user) { create(:user, with_individual_account: true) }
  let(:existing_token) { StubToken.new(nil, nil, existing_user.id) }
  let(:new_user) { create(:user, with_individual_account: false) }
  let(:new_token) { StubToken.new(nil, nil, new_user.id) }
  let(:account) { build_stubbed(:individual_account) }

  describe '#create?' do
    it 'returns true for user without individual account' do
      IndividualAccountPolicy.new(new_token, account).must_allow :create?
    end
    it 'returns false for user with individual account' do
      IndividualAccountPolicy.new(existing_token, account).wont_allow :create?
    end
  end
end
{'fraction_non_alphanumeric': 0.10440677966101695, 'fraction_numerical': 0.0, 'mean_word_length': 5.254237288135593, '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': '1208464', 'n_tokens_mistral': 457, 'n_tokens_neox': 444, 'n_words': 112}