summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorAzul <azul@leap.se>2013-02-25 13:19:23 +0100
committerAzul <azul@leap.se>2013-02-25 13:31:58 +0100
commit9c4eb32c22e6bf49d84b6ac1fa4fc5cde5374a7a (patch)
treeb302a527ce939dd498b68f4f87dbcd95bfb8cf26 /core
parent494ebdab860a4db792e1c61836f1efcb7593dfe7 (diff)
tests refactored with with_config helper
also added test for getting paid certs if free certs are disabled
Diffstat (limited to 'core')
-rw-r--r--core/test/support/with_config_helper.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/core/test/support/with_config_helper.rb b/core/test/support/with_config_helper.rb
new file mode 100644
index 0000000..65eb7bc
--- /dev/null
+++ b/core/test/support/with_config_helper.rb
@@ -0,0 +1,16 @@
+module WithConfigHelper
+ extend ActiveSupport::Concern
+
+ def with_config(options)
+ old_config = APP_CONFIG.dup
+ APP_CONFIG.merge! options
+ yield
+ ensure
+ APP_CONFIG.replace old_config
+ end
+
+end
+
+class ActiveSupport::TestCase
+ include WithConfigHelper
+end