<commit_before>require_relative './test_helper.rb'
require 'byebug'

require_relative '../models/user.rb'
require_relative '../models/tweet.rb'
#require_relative '../models/mention.rb'
require_relative '../tweetprocessor.rb'

describe "Tweet Processor" do

  def app
    Sinatra::Application
  end

  before(:each) do
    User.destroy_all
  end

  it "replaces mentions with user URLs" do
    t = TweetProcessor.new
    User.create(name: "John", email: "<EMAIL>", user_name: "TestUser", password: "<PASSWORD>")
    processed_tweet = t.process_text("Test text @TestUser")
    assert processed_tweet[0].include?("<a href=\"/user/TestUser\">")
  end

  it "does not replace mentions if the user does not exist" do
    t = TweetProcessor.new
    user_exists = User.where(user_name: "RubyHater").exists?
    processed_tweet = t.process_text("No one hates ruby, @RubyHater")
    assert !user_exists && !processed_tweet[0].include?("a href=\"user/RubyHater\">")
  end

  it "replaces tags with tag search URLs" do
    t = TweetProcessor.new
    processed_tweet = t.process_text("I love Ruby #Ruby")
    assert processed_tweet[0].include?("<a href=\"search/tag=Ruby\">")
  end

  #it "creates mentions for all mentioned users" do
  #  u = User.create(name: "Mary", user_name: "TestUser", email: "<EMAIL>", password: "<PASSWORD>")
  #  v = User.create(name: "John", user_name: "TestUser2", email: "<EMAIL>", password: "<PASSWORD>")
  #  t = TweetProcessor.new
  #  tweet = t.make_tweet("Thanks for Beta Testing! @TestUser and @TestUser2", u.id)
  #  assert Mention.where(user: u).exists? && Mention.where(user: v).exists?
  #end

  #it "creates tags for all tags in the tweet"

end<commit_msg>changes before video for pito, all functionality seems complete<commit_after>require_relative './test_helper.rb'
require 'byebug'

require_relative '../models/user.rb'
require_relative '../models/tweet.rb'
#require_relative '../models/mention.rb'
require_relative '../tweetprocessor.rb'

describe "Tweet Processor" do

  def app
    Sinatra::Application
  end

  before(:each) do
    User.destroy_all
  end

  # it "replaces mentions with user URLs" do
  #   t = TweetProcessor.new
  #   User.create(name: "John", email: "<EMAIL>", user_name: "TestUser", password: "<PASSWORD>")
  #   processed_tweet = t.process_text("Test text @TestUser")
  #   assert processed_tweet[0].include?("<a href=\"/user/TestUser\">")
  # end

  # it "does not replace mentions if the user does not exist" do
  #   t = TweetProcessor.new
  #   user_exists = User.where(user_name: "RubyHater").exists?
  #   processed_tweet = t.process_text("No one hates ruby, @RubyHater")
  #   assert !user_exists && !processed_tweet[0].include?("a href=\"user/RubyHater\">")
  # end

  # it "replaces tags with tag search URLs" do
  #   t = TweetProcessor.new
  #   processed_tweet = t.process_text("I love Ruby #Ruby")
  #   assert processed_tweet[0].include?("<a href=\"search/tag=Ruby\">")
  # end

  #it "creates mentions for all mentioned users" do
  #  u = User.create(name: "Mary", user_name: "TestUser", email: "<EMAIL>", password: "<PASSWORD>")
  #  v = User.create(name: "John", user_name: "TestUser2", email: "<EMAIL>", password: "<PASSWORD>")
  #  t = TweetProcessor.new
  #  tweet = t.make_tweet("Thanks for Beta Testing! @TestUser and @TestUser2", u.id)
  #  assert Mention.where(user: u).exists? && Mention.where(user: v).exists?
  #end

  #it "creates tags for all tags in the tweet"

end
{'fraction_non_alphanumeric': 0.14947856315179606, 'fraction_numerical': 0.0028968713789107765, 'mean_word_length': 4.138392857142857, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 21, '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': '1659279', 'n_tokens_mistral': 1213, 'n_tokens_neox': 1162, 'n_words': 305}