mirror of
https://github.com/discourse/discourse.git
synced 2025-05-31 20:15:17 +08:00
DEV: s/\$redis/Discourse\.redis (#8431)
This commit also adds a rubocop rule to prevent global variables.
This commit is contained in:
@ -35,18 +35,18 @@ describe GlobalSetting do
|
||||
freeze_time Time.now
|
||||
|
||||
token = GlobalSetting.safe_secret_key_base
|
||||
$redis.without_namespace.del(GlobalSetting::REDIS_SECRET_KEY)
|
||||
Discourse.redis.without_namespace.del(GlobalSetting::REDIS_SECRET_KEY)
|
||||
freeze_time Time.now + 20
|
||||
|
||||
GlobalSetting.safe_secret_key_base
|
||||
new_token = $redis.without_namespace.get(GlobalSetting::REDIS_SECRET_KEY)
|
||||
new_token = Discourse.redis.without_namespace.get(GlobalSetting::REDIS_SECRET_KEY)
|
||||
expect(new_token).to eq(nil)
|
||||
|
||||
freeze_time Time.now + 11
|
||||
|
||||
GlobalSetting.safe_secret_key_base
|
||||
|
||||
new_token = $redis.without_namespace.get(GlobalSetting::REDIS_SECRET_KEY)
|
||||
new_token = Discourse.redis.without_namespace.get(GlobalSetting::REDIS_SECRET_KEY)
|
||||
expect(new_token).to eq(token)
|
||||
|
||||
end
|
||||
|
Reference in New Issue
Block a user