<commit_before>require 'spec_helper'
require 'travis/caching/app'

describe Travis::Caching::App, :include_sinatra_helpers do

  before(:each) do
    set_app described_class.new
    ENV['TRAVIS_JWT_SECRET'] = '<PASSWORD>'
    header('Content-Type', 'application/json')
  end

  describe '/uptime' do
    it 'returns 204' do
      response = get '/uptime'
      expect(response.status).to be == 204
    end
  end
end<commit_msg>Add spec for GET /cache<commit_after>require 'spec_helper'
require 'travis/caching/app'

describe Travis::Caching::App, :include_sinatra_helpers do

  before(:each) do
    set_app described_class.new
    ENV['TRAVIS_JWT_SECRET'] = '<PASSWORD>'
    header('Content-Type', 'application/json')
  end

  describe '/uptime' do
    it 'returns 204' do
      response = get '/uptime'
      expect(response.status).to be == 204
    end
  end

  describe 'GET /cache' do
    let(:token) {
      # payload with no time stamps
      '<KEY>'
    }

    it 'decodes payload correctly' do
      response = get "/cache?token=#{token}"
      expect(response.status).to be == 200
    end
  end
end
{'fraction_non_alphanumeric': 0.12195121951219512, 'fraction_numerical': 0.013550135501355014, 'mean_word_length': 3.277992277992278, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 6, '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': '5289568', 'n_tokens_mistral': 389, 'n_tokens_neox': 365, 'n_words': 93}