<commit_before>#   Copyright (c) 2010-2011, Diaspora Inc.  This file is
#   licensed under the Affero General Public License version 3 or later.  See
#   the COPYRIGHT file.

require 'spec_helper'

require File.join(Rails.root, 'lib/webfinger')

describe Webfinger do
  let(:host_with_port) { "#{AppConfig.pod_uri.host}:#{AppConfig.pod_uri.port}" }
  let(:user1) { alice }
  let(:user2) { eve }

  let(:account) {"<EMAIL>"}
  let(:person){ Factory(:person, :diaspora_handle => account)}
  let(:finger){Webfinger.new(account)}

  let(:good_request) { FakeHttpRequest.new(:success)}

  let(:diaspora_xrd) {File.open(File.join(Rails.root, 'spec/fixtures/host-meta.fixture.html')).read}
  let(:diaspora_finger) {File.open(File.join(Rails.root, 'spec/fixtures/webfinger.fixture.html')).read}
  let(:hcard_xml) {File.open(File.join(Rails.root, 'spec/fixtures/hcard.fixture.html')).read}


  let(:non_diaspora_xrd) {File.open(File.join(Rails.root, 'spec/fixtures/nonseed_finger_xrd')).read}
  let(:non_diaspora_hcard) {File.open(File.join(Rails.root, 'spec/fixtures/evan_hcard')).read}

  context 'setup' do<commit_msg>Try doing join differently for travis<commit_after>#   Copyright (c) 2010-2011, Diaspora Inc.  This file is
#   licensed under the Affero General Public License version 3 or later.  See
#   the COPYRIGHT file.

require 'spec_helper'

require File.join(Rails.root, 'lib/webfinger')

describe Webfinger do
  let(:host_with_port) { "#{AppConfig.pod_uri.host}:#{AppConfig.pod_uri.port}" }
  let(:user1) { alice }
  let(:user2) { eve }

  let(:account) {"<EMAIL>"}
  let(:person){ Factory(:person, :diaspora_handle => account)}
  let(:finger){Webfinger.new(account)}

  let(:good_request) { FakeHttpRequest.new(:success)}

  let(:diaspora_xrd) {File.open(File.join(Rails.root, 'spec', 'fixtures', 'host-meta.fixture.html')).read}
  let(:diaspora_finger) {File.open(File.join(Rails.root, 'spec', 'fixtures', 'webfinger.fixture.html')).read}
  let(:hcard_xml) {File.open(File.join(Rails.root, 'spec', 'fixtures', 'hcard.fixture.html')).read}

  context 'setup' do
{'fraction_non_alphanumeric': 0.1702127659574468, 'fraction_numerical': 0.010638297872340425, 'mean_word_length': 5.5474683544303796, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, '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': '5186636', 'n_tokens_mistral': 806, 'n_tokens_neox': 773, 'n_words': 134}