<commit_before>require_relative '../../app/classes/fact_url'
require 'cgi'
require 'uri'

describe FactUrl do

  before do
    stub_const 'FactlinkUI::Application', Class.new
    config = double core_url:  'https://site.com',
                    proxy_url: 'http://proxy.com'
    FactlinkUI::Application.stub(config: config)
  end

  describe '.friendly_fact_url' do
    it 'returns the correct url' do
      fact = double id: '2'

      fact_url = FactUrl.new fact

      expect(fact_url.friendly_fact_url)
        .to eq "https://site.com/f/2"
    end
  end

  describe '.proxy_open_url' do
    it 'returns the correct url' do<commit_msg>Don't bother checking uninteresting method<commit_after>require_relative '../../app/classes/fact_url'
require 'cgi'
require 'uri'

describe FactUrl do

  before do
    stub_const 'FactlinkUI::Application', Class.new
    config = double core_url:  'https://site.com',
                    proxy_url: 'http://proxy.com'
    FactlinkUI::Application.stub(config: config)
  end

  describe '.proxy_open_url' do
    it 'returns the correct url' do
{'fraction_non_alphanumeric': 0.11481481481481481, 'fraction_numerical': 0.001851851851851852, 'mean_word_length': 3.0185873605947955, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 3, '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': '1345709', 'n_tokens_mistral': 351, 'n_tokens_neox': 336, 'n_words': 89}