mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 17:51:16 +08:00
DEV: Use FakeLogger
in RequestTracker specs (#16640)
`TestLogger` was responsible for some flaky specs runs: ``` Error during failsafe response: undefined method `debug' for #<TestLogger:0x0000556c4b942cf0 @warnings=1> Did you mean? debugger ``` This commit also cleans up other uses of `FakeLogger`
This commit is contained in:
@ -383,19 +383,19 @@ describe Discourse do
|
||||
expect(old_method_caller(k)).to include("discourse_spec")
|
||||
expect(old_method_caller(k)).to include(k)
|
||||
|
||||
expect(Rails.logger.warnings).to eq([old_method_caller(k)])
|
||||
expect(@fake_logger.warnings).to eq([old_method_caller(k)])
|
||||
end
|
||||
|
||||
it 'can report the deprecated version' do
|
||||
Discourse.deprecate(SecureRandom.hex, since: "2.1.0.beta1")
|
||||
|
||||
expect(Rails.logger.warnings[0]).to include("(deprecated since Discourse 2.1.0.beta1)")
|
||||
expect(@fake_logger.warnings[0]).to include("(deprecated since Discourse 2.1.0.beta1)")
|
||||
end
|
||||
|
||||
it 'can report the drop version' do
|
||||
Discourse.deprecate(SecureRandom.hex, drop_from: "2.3.0")
|
||||
|
||||
expect(Rails.logger.warnings[0]).to include("(removal in Discourse 2.3.0)")
|
||||
expect(@fake_logger.warnings[0]).to include("(removal in Discourse 2.3.0)")
|
||||
end
|
||||
|
||||
it 'can raise deprecation error' do
|
||||
|
Reference in New Issue
Block a user