mirror of
https://github.com/hakanensari/frankfurter.git
synced 2024-11-25 04:22:28 +01:00
21 lines
408 B
Ruby
21 lines
408 B
Ruby
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
|
|
end
|