mirror of
https://github.com/hakanensari/frankfurter.git
synced 2024-10-29 23:32:35 +01:00
cfbb4ac4ac
I'm moving my company's server to a private location now that I have sold the domain. While prepping for this, I've done some cleanup and also threw in changes I had lingering on my hard drive. - Run a single database query instead of two - Fold the gem into the app and use Ox instead of REXML - Simplify error handling logic - Relax throttling
33 lines
528 B
Ruby
33 lines
528 B
Ruby
# frozen_string_literal: true
|
|
|
|
require_relative 'helper'
|
|
require 'bank'
|
|
|
|
describe Bank do
|
|
around do |test|
|
|
Currency.db.transaction do
|
|
test.call
|
|
raise Sequel::Rollback
|
|
end
|
|
end
|
|
|
|
before do
|
|
VCR.insert_cassette 'feed'
|
|
Currency.dataset.delete
|
|
end
|
|
|
|
after do
|
|
VCR.eject_cassette
|
|
end
|
|
|
|
it 'fetches all rates' do
|
|
Bank.fetch_all_rates!
|
|
Currency.count.must_be :positive?
|
|
end
|
|
|
|
it 'fetches current rates' do
|
|
Bank.fetch_current_rates!
|
|
Currency.count.must_be :positive?
|
|
end
|
|
end
|