<commit_before>require 'spec_helper'

describe Spree::Marketing::NewUsersList, type: :model do

  let!(:new_user) { create(:user) }
  let!(:old_user) { create(:user, created_at: Time.current - 10.days) }

  describe 'Constants' do
    it 'NAME_TEXT equals to name representation for list' do
      expect(Spree::Marketing::NewUsersList::NAME_TEXT).to eq 'New Users'
    end
  end

  describe 'methods' do
    context '#emails' do
      it { expect(Spree::Marketing::NewUsersList.new.send :emails).to include new_user.email }
      it { expect(Spree::Marketing::NewUsersList.new.send :emails).to_not include old_user.email }
    end
  end

end<commit_msg>add spec for constant also<commit_after>require 'spec_helper'

describe Spree::Marketing::NewUsersList, type: :model do

  let!(:new_user) { create(:user) }
  let!(:old_user) { create(:user, created_at: Time.current - 10.days) }

  describe 'Constants' do
    it 'NAME_TEXT equals to name representation for list' do
      expect(Spree::Marketing::NewUsersList::NAME_TEXT).to eq 'New Users'
    end
    it 'AVAILABLE_REPORTS equals to array of method names for reports' do
      expect(Spree::Marketing::NewUsersList::AVAILABLE_REPORTS).to eq [:log_ins_by, :cart_additions_by, :purchases_by, :product_views_by]
    end
  end

  describe 'methods' do
    context '#emails' do
      it { expect(Spree::Marketing::NewUsersList.new.send :emails).to include new_user.email }
      it { expect(Spree::Marketing::NewUsersList.new.send :emails).to_not include old_user.email }
    end
  end

end
{'fraction_non_alphanumeric': 0.11810512654120701, 'fraction_numerical': 0.0025957170668397143, 'mean_word_length': 4.468085106382978, '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': '2888002', 'n_tokens_mistral': 523, 'n_tokens_neox': 510, 'n_words': 123}