<commit_before>require 'test_helper'

class GeoHelperTest < ActionView::TestCase
  include GeoHelper

  test "should get ip address" do
    @request.headers["REMOTE_ADDR"] = "192.168.127.12"
    ip = GeoHelper.get_ip_address(@request)

    assert_equal(ip, "192.168.127.12")
  end 

  test "should suggest location with ip address" do
    suggestion = GeoHelper.suggest "8.8.8.8"
    assert_equal("Mountain View, California, Estados Unidos", suggestion)
  end

  test "should suggest properly translated locations" do
    I18n.locale = :en
    suggestion = GeoHelper.suggest "8.8.8.8"
    assert_equal("Mountain View, California, United States", suggestion)
    I18n.locale = :es<commit_msg>Expected goes before actual value<commit_after>require 'test_helper'

class GeoHelperTest < ActionView::TestCase
  include GeoHelper

  test "should get ip address" do
    @request.headers["REMOTE_ADDR"] = "192.168.127.12"
    ip = GeoHelper.get_ip_address(@request)

    assert_equal("192.168.127.12", ip)
  end 

  test "should suggest location with ip address" do
    suggestion = GeoHelper.suggest "8.8.8.8"
    assert_equal("Mountain View, California, Estados Unidos", suggestion)
  end

  test "should suggest properly translated locations" do
    I18n.locale = :en
    suggestion = GeoHelper.suggest "8.8.8.8"
    assert_equal("Mountain View, California, United States", suggestion)
    I18n.locale = :es
{'fraction_non_alphanumeric': 0.10413694721825963, 'fraction_numerical': 0.04850213980028531, 'mean_word_length': 4.064981949458484, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 8, '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': '2863778', 'n_tokens_mistral': 486, 'n_tokens_neox': 431, 'n_words': 119}