DEV: no instance variables in specs

This commit is contained in:
Régis Hanol 2024-11-04 18:20:49 +01:00
parent 07ed495392
commit b6c1020fbf
No known key found for this signature in database
2 changed files with 6 additions and 10 deletions

View File

@ -4,12 +4,10 @@ RSpec.describe Chat::AutoJoinChannels do
describe ".call" do
subject(:result) { described_class.call(params: {}) }
before do
@previous_events = DiscourseEvent.events.dup
DiscourseEvent.events.clear
end
let!(:previous_events) { DiscourseEvent.events.dup }
after { @previous_events.each { |event, handlers| DiscourseEvent.events[event] = handlers } }
before { DiscourseEvent.events.clear }
after { previous_events.each { |event, handlers| DiscourseEvent.events[event] = handlers } }
context "when chat is disabled" do
before { SiteSetting.chat_enabled = false }

View File

@ -4,12 +4,10 @@ RSpec.describe Chat::AutoLeaveChannels do
describe ".call" do
subject(:result) { described_class.call(params: {}) }
before do
@previous_events = DiscourseEvent.events.dup
DiscourseEvent.events.clear
end
let!(:previous_events) { DiscourseEvent.events.dup }
after { @previous_events.each { |event, handlers| DiscourseEvent.events[event] = handlers } }
before { DiscourseEvent.events.clear }
after { previous_events.each { |event, handlers| DiscourseEvent.events[event] = handlers } }
context "when chat is disabled" do
before { SiteSetting.chat_enabled = false }