Skip to content

A platform for community discussion. Free, open, simple.

workaround fabricator not working correctly

Sam Saffron003df147a59e
diff --git a/db/fixtures/000_delayed_drops.rb b/db/fixtures/000_delayed_drops.rb
index eda3f843dbc..bf07dcb7251 100644
--- a/db/fixtures/000_delayed_drops.rb
+++ b/db/fixtures/000_delayed_drops.rb
@@ -181,5 +181,4 @@ Migration::TableDropper.delayed_drop(
}
)
-STDERR.puts "Resetting Active Record Cache"
Discourse.reset_active_record_cache
diff --git a/spec/models/topic_timer_spec.rb b/spec/models/topic_timer_spec.rb
index dec05487fc3..b702f9a77e4 100644
--- a/spec/models/topic_timer_spec.rb
+++ b/spec/models/topic_timer_spec.rb
@@ -1,7 +1,16 @@
require 'rails_helper'
RSpec.describe TopicTimer, type: :model do
- let(:topic_timer) { Fabricate(:topic_timer) }
+ let(:topic_timer) {
+ # we should not need to do this but somehow
+ # fabricator is failing here
+ TopicTimer.create!(
+ user_id: -1,
+ topic: Fabricate(:topic),
+ execute_at: 1.hour.from_now,
+ status_type: TopicTimer.types[:close]
+ )
+ }
let(:topic) { Fabricate(:topic) }
let(:admin) { Fabricate(:admin) }