mirror of
https://github.com/TracksApp/tracks.git
synced 2026-01-30 20:55:17 +01:00
Isolate SITE_CONFIG in tests using minitest-stub-const
This commit is contained in:
parent
3de582f436
commit
58e2b82315
6 changed files with 130 additions and 96 deletions
9
test/support/stub_site_config_helper.rb
Normal file
9
test/support/stub_site_config_helper.rb
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
require 'minitest/stub_const'
|
||||
|
||||
module StubSiteConfigHelper
|
||||
def stub_site_config
|
||||
Object.stub_const(:SITE_CONFIG, SITE_CONFIG.clone) do
|
||||
yield
|
||||
end
|
||||
end
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue