mirror of
https://github.com/hakanensari/frankfurter.git
synced 2024-10-29 23:32:35 +01:00
Upcase symbols
This commit is contained in:
parent
79f1972361
commit
d107134548
@ -16,7 +16,7 @@ class Query
|
||||
end
|
||||
|
||||
def symbols
|
||||
@params.values_at(:to, :symbols).compact.first&.split(',')
|
||||
@params.values_at(:to, :symbols).compact.first&.upcase&.split(',')
|
||||
end
|
||||
|
||||
def date
|
||||
|
@ -19,6 +19,11 @@ describe Query do
|
||||
query.base.must_equal 'USD'
|
||||
end
|
||||
|
||||
it 'upcases given base' do
|
||||
query = Query.new(base: 'usd')
|
||||
query.base.must_equal 'USD'
|
||||
end
|
||||
|
||||
it 'defaults base to nothing' do
|
||||
query = Query.new
|
||||
query.base.must_be_nil
|
||||
@ -34,6 +39,11 @@ describe Query do
|
||||
query.symbols.must_equal %w[USD GBP]
|
||||
end
|
||||
|
||||
it 'upcases given symbols' do
|
||||
query = Query.new(symbols: 'usd,gbp')
|
||||
query.symbols.must_equal %w[USD GBP]
|
||||
end
|
||||
|
||||
it 'aliases symbols with to' do
|
||||
query = Query.new(to: 'USD')
|
||||
query.symbols.must_equal ['USD']
|
||||
|
Loading…
Reference in New Issue
Block a user