mirror of
https://github.com/hakanensari/frankfurter.git
synced 2024-11-21 18:42:29 +01:00
Root returns link to docs
This commit is contained in:
parent
1116343424
commit
7e2c69132d
@ -4,10 +4,14 @@ This project adheres to [Semantic Versioning](http://semver.org/).
|
||||
|
||||
## [Unreleased]
|
||||
### Changed
|
||||
- Root returns link to docs
|
||||
- Handle rounding edge case where a lower-rate base currency like IDR produces less precise quotes
|
||||
- Sample weekly when querying over a year
|
||||
- Bump PostgreSQL to 12
|
||||
|
||||
### Fixed
|
||||
- Set charset to UTF-8
|
||||
|
||||
## 1.0.0 - 2020-01-02
|
||||
### Fixed
|
||||
- Start versioning images so users can track changes
|
||||
|
@ -57,17 +57,17 @@ helpers do
|
||||
callback = params['callback']
|
||||
|
||||
if callback
|
||||
content_type :js
|
||||
content_type :js, charset: Encoding::UTF_8
|
||||
"#{callback}(#{json})"
|
||||
else
|
||||
content_type :json
|
||||
content_type :json, charset: Encoding::UTF_8
|
||||
json
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
get '/' do
|
||||
redirect 'https://www.frankfurter.app', 301
|
||||
json({ docs: 'https://wwww.frankfurter.app/docs' })
|
||||
end
|
||||
|
||||
get '/(?:latest|current)', mustermann_opts: { type: :regexp } do
|
||||
|
@ -11,9 +11,9 @@ describe 'the server' do
|
||||
let(:json) { Oj.load(last_response.body) }
|
||||
let(:headers) { last_response.headers }
|
||||
|
||||
it 'redirects root to documentation site' do
|
||||
it 'returns link to docs' do
|
||||
get '/'
|
||||
_(last_response).must_be :redirect?
|
||||
_(json['docs']).wont_be_nil
|
||||
end
|
||||
|
||||
it 'returns latest quotes' do
|
||||
@ -102,4 +102,9 @@ describe 'the server' do
|
||||
get '/latest?callback=foo'
|
||||
_(last_response.body).must_be :start_with?, 'foo'
|
||||
end
|
||||
|
||||
it 'sets charset to UTF-8' do
|
||||
get '/currencies'
|
||||
_(last_response.headers['content-type']).must_be :end_with?, 'charset=UTF-8'
|
||||
end
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user