From 0ffd40867466b0f6b6fbcbc08e01d1a62633d915 Mon Sep 17 00:00:00 2001 From: Alan Guo Xiang Tan Date: Tue, 25 Oct 2022 06:18:40 +0800 Subject: [PATCH] DEV: Remove harded id when fabricating in tests (#18729) Hardcoding ids always lead to sadness for our test suite --- spec/lib/topic_view_spec.rb | 2 +- spec/serializers/post_serializer_spec.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/spec/lib/topic_view_spec.rb b/spec/lib/topic_view_spec.rb index 7282eca5352..469c19a6b41 100644 --- a/spec/lib/topic_view_spec.rb +++ b/spec/lib/topic_view_spec.rb @@ -1001,7 +1001,7 @@ RSpec.describe TopicView do subject(:topic_view) { described_class.new(topic, user) } let(:topic) { Fabricate(:topic) } - let(:user) { Fabricate(:user, id: 1) } + let(:user) { Fabricate(:user) } let(:category) { topic.category } before do diff --git a/spec/serializers/post_serializer_spec.rb b/spec/serializers/post_serializer_spec.rb index 0ae41c669bc..55ac7c961c0 100644 --- a/spec/serializers/post_serializer_spec.rb +++ b/spec/serializers/post_serializer_spec.rb @@ -129,7 +129,7 @@ RSpec.describe PostSerializer do end context "with a hidden post with add_raw enabled" do - let(:user) { Fabricate(:user, id: -99999) } + let(:user) { Fabricate(:user) } let(:raw) { "Raw contents of the post." } context "with a public post" do