mirror of
https://github.com/internetee/registry.git
synced 2025-07-23 19:20:37 +02:00
parent
19f9a4eb71
commit
62c38d1f99
29 changed files with 660 additions and 16 deletions
|
@ -0,0 +1,32 @@
|
|||
require 'test_helper'
|
||||
|
||||
class RegistrarAreaSettingsBalanceAutoReloadIntegrationTest < ActionDispatch::IntegrationTest
|
||||
include Devise::Test::IntegrationHelpers
|
||||
|
||||
setup do
|
||||
@registrar = registrars(:bestnames)
|
||||
sign_in users(:api_bestnames)
|
||||
end
|
||||
|
||||
def test_updates_balance_auto_reload_setting
|
||||
amount = 100
|
||||
threshold = 10
|
||||
assert_nil @registrar.settings['balance_auto_reload']
|
||||
|
||||
patch registrar_settings_balance_auto_reload_path, { type: { amount: amount,
|
||||
threshold: threshold } }
|
||||
@registrar.reload
|
||||
|
||||
assert_equal amount, @registrar.settings['balance_auto_reload']['type']['amount']
|
||||
assert_equal threshold, @registrar.settings['balance_auto_reload']['type']['threshold']
|
||||
end
|
||||
|
||||
def test_disables_balance_auto_reload_setting
|
||||
@registrar.update!(settings: { balance_auto_reload: { amount: 'any', threshold: 'any' } })
|
||||
|
||||
delete registrar_settings_balance_auto_reload_path
|
||||
@registrar.reload
|
||||
|
||||
assert_nil @registrar.settings['balance_auto_reload']
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue