<commit_before>require_relative 'helper'
require 'rack/test'
require 'app'

describe 'the application' do
  include Rack::Test::Methods

  let(:app)  { Sinatra::Application }
  let(:json) { Yajl::Parser.new.parse last_response.body }

  it 'returns latest snapshot' do
    get '/latest'
    assert last_response.ok?
  end

  it 'sets base currency' do
    get '/latest?base=USD'
    json['base'].must_equal 'USD'
  end

  it 'filters symbols' do
    skip 'enterprise feature'
    get '/latest?symbols=USD'
    json['rates'].keys.must_equal %w(USD)
  end
end<commit_msg>History requests should work around holidays<commit_after>require_relative 'helper'
require 'rack/test'
require 'app'

describe 'the application' do
  include Rack::Test::Methods

  let(:app)  { Sinatra::Application }
  let(:json) { Yajl::Parser.new.parse last_response.body }

  it 'returns latest snapshot' do
    get '/latest'
    assert last_response.ok?
  end

  it 'sets base currency' do
    get '/latest?base=USD'
    json['base'].must_equal 'USD'
  end

  it 'filters symbols' do
    skip 'enterprise feature'
    get '/latest?symbols=USD'
    json['rates'].keys.must_equal %w(USD)
  end

  it 'returns historical data' do
    get '/2012-11-20'
    json['rates'].wont_be :empty?
  end

  it 'works around holidays' do
    skip 'an "oh, wow" feature'
    get '/2010-01-01'
    json['rates'].wont_be :empty?
  end
end
{'fraction_non_alphanumeric': 0.12706389088298636, 'fraction_numerical': 0.01148600143575018, 'mean_word_length': 3.6312292358803986, 'pattern_counts': {'":': 0, '<': 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': '5127639', 'n_tokens_mistral': 499, 'n_tokens_neox': 461, 'n_words': 129}