From 0358931b9f0a7f66188de34f29ba64ffa405f717 Mon Sep 17 00:00:00 2001 From: Sam Date: Fri, 29 Sep 2017 12:58:15 +1000 Subject: [PATCH] correct erratic spec --- spec/jobs/publish_topic_to_category_spec.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/spec/jobs/publish_topic_to_category_spec.rb b/spec/jobs/publish_topic_to_category_spec.rb index 2090b3106f4..ebb5e79663b 100644 --- a/spec/jobs/publish_topic_to_category_spec.rb +++ b/spec/jobs/publish_topic_to_category_spec.rb @@ -50,7 +50,9 @@ RSpec.describe Jobs::PublishTopicToCategory do message = MessageBus.track_publish do described_class.new.execute(topic_timer_id: topic.public_topic_timer.id) - end.first + end.find do |m| + Hash === m.data && m.data.key?(:reload_topic) + end topic.reload expect(topic.category).to eq(another_category)