From 003df147a59e53ef6e94a330137fa07e2651ebb9 Mon Sep 17 00:00:00 2001 From: Sam Saffron Date: Tue, 12 Jun 2018 14:44:59 +1000 Subject: [PATCH] workaround fabricator not working correctly --- db/fixtures/000_delayed_drops.rb | 1 - spec/models/topic_timer_spec.rb | 11 ++++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) 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) }