<commit_before>require 'rails_helper'

describe LinkApiResponsePresenter do
  describe '#present' do
    let(:authority) { build(:district_council) }
    let(:presenter) { described_class.new(authority, link) }

    context 'link is present' do
      let(:link) { build(:link) }
      let(:expected_response) do
        {
          "local_authority" => {
            "name" => authority.name,
            "snac" => authority.snac,
            "tier" => 'district',<commit_msg>Fix test by creating link associations<commit_after>require 'rails_helper'

describe LinkApiResponsePresenter do
  describe '#present' do
    let(:authority) { build(:district_council) }
    let(:presenter) { described_class.new(authority, link) }

    context 'link is present' do
      let(:link) { create(:link) }
      let(:expected_response) do
        {
          "local_authority" => {
            "name" => authority.name,
            "snac" => authority.snac,
            "tier" => 'district',
{'fraction_non_alphanumeric': 0.12883435582822086, 'fraction_numerical': 0.0, 'mean_word_length': 2.82421875, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, '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': '6810443', 'n_tokens_mistral': 300, 'n_tokens_neox': 285, 'n_words': 62}