From 68c6fb6c17a6391b3669b7051ff0da243693c1c0 Mon Sep 17 00:00:00 2001 From: Hakan Ensari Date: Wed, 21 Nov 2012 00:10:18 +0000 Subject: [PATCH] We should be able to set base currency --- spec/snapshots_spec.rb | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 spec/snapshots_spec.rb diff --git a/spec/snapshots_spec.rb b/spec/snapshots_spec.rb new file mode 100644 index 0000000..6b7c156 --- /dev/null +++ b/spec/snapshots_spec.rb @@ -0,0 +1,21 @@ +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 + skip 'pending' + get '/latest?base=USD' + json['base'].must_equal 'USD' + end +end