<commit_before>require 'spec_helper.rb'

describe PlosDetails do
  let(:plos_paper) do
    create(:plos_paper, id: 1, reader: 0, doi: '10.1371/journal.pone.0089204')
  end
  let(:job) {PlosDetails.new}

  it 'updates the view count' do
    before = plos_paper.reader

    response = double('response', body: '{"views":23}')
    expect(Net::HTTP).to receive(:get_response).
        with(URI 'http://alm.plos.org/api/v3/articles/10.1371/journal.pone.0089204?api_key=foo').
        and_return(response)
    
    job.perform plos_paper.id
    expect(plos_paper.reader).to eq(23)
  end
end
<commit_msg>Hound<commit_after>require 'spec_helper.rb'

describe PlosDetails do
  let(:plos_paper) do
    create(:plos_paper, id: 1, reader: 0, doi: '10.1371/journal.pone.0089204')
  end
  let(:job) {PlosDetails.new}

  it 'updates the view count' do
    before = plos_paper.reader

    response = double('response', body: '{"views":23}')
    expect(Net::HTTP).to receive(:get_response)
      .with(URI('http://alm.plos.org/api/v3/articles/10.1371/journal.pone.0089204?api_key=foo'))
      .and_return(response)
    
    job.perform plos_paper.id
    expect(plos_paper.reader).to eq(23)
  end
end

{'fraction_non_alphanumeric': 0.14877430262045646, 'fraction_numerical': 0.055790363482671176, 'mean_word_length': 3.774193548387097, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 3, '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': '5505133', 'n_tokens_mistral': 494, 'n_tokens_neox': 437, 'n_words': 79}