From 469312d7ee380d7343cd750a5240ed38324f43e9 Mon Sep 17 00:00:00 2001 From: Artur Beljajev Date: Fri, 28 Oct 2016 00:25:43 +0300 Subject: [PATCH] Add settings rspec support #186 --- spec/rails_helper.rb | 1 + spec/support/settings.rb | 26 ++++++++++++++++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 spec/support/settings.rb diff --git a/spec/rails_helper.rb b/spec/rails_helper.rb index 3403af964..9411702f5 100644 --- a/spec/rails_helper.rb +++ b/spec/rails_helper.rb @@ -16,6 +16,7 @@ require 'support/matchers/active_job' require 'support/capybara' require 'support/database_cleaner' require 'support/paper_trail' +require 'support/settings' ActiveRecord::Migration.maintain_test_schema! diff --git a/spec/support/settings.rb b/spec/support/settings.rb new file mode 100644 index 000000000..7a5aebf3b --- /dev/null +++ b/spec/support/settings.rb @@ -0,0 +1,26 @@ +RSpec.configure do |config| + config.before :example do |example| + if example.metadata[:db] + Fabricate(:zonefile_setting, origin: 'com') + + Setting.ds_algorithm = 2 + Setting.ds_data_allowed = true + Setting.ds_data_with_key_allowed = true + Setting.key_data_allowed = true + + Setting.dnskeys_min_count = 0 + Setting.dnskeys_max_count = 9 + Setting.ns_min_count = 2 + Setting.ns_max_count = 11 + + Setting.transfer_wait_time = 0 + + Setting.admin_contacts_min_count = 1 + Setting.admin_contacts_max_count = 10 + Setting.tech_contacts_min_count = 0 + Setting.tech_contacts_max_count = 10 + + Setting.client_side_status_editing_enabled = true + end + end +end