mirror of
https://github.com/internetee/registry.git
synced 2025-06-11 07:04:47 +02:00
parent
d85e57d800
commit
7723a30d1b
17 changed files with 240 additions and 200 deletions
|
@ -1,20 +1,12 @@
|
|||
require 'test_helper'
|
||||
|
||||
class RegistryTest < ActiveSupport::TestCase
|
||||
setup do
|
||||
@registry = Registry.send(:new)
|
||||
def test_returns_current_registry
|
||||
Setting.registry_vat_prc = 0.2
|
||||
Setting.registry_country_code = 'US'
|
||||
|
||||
registry = Registry.current
|
||||
assert_equal 20, registry.vat_rate
|
||||
assert_equal Country.new(:us), registry.vat_country
|
||||
end
|
||||
|
||||
def test_implements_singleton
|
||||
assert_equal Registry.instance.object_id, Registry.instance.object_id
|
||||
end
|
||||
|
||||
def test_vat_rate
|
||||
original_vat_prc = Setting.registry_vat_prc
|
||||
Setting.registry_vat_prc = 0.25
|
||||
|
||||
assert_equal BigDecimal(25), @registry.vat_rate
|
||||
|
||||
Setting.registry_vat_prc = original_vat_prc
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue