A platform for community discussion. Free, open, simple.
FIX: first post true if user creates topic first (#8139)
Justin DiRose63fabdb6f2cc
diff --git a/lib/new_post_manager.rb b/lib/new_post_manager.rbindex c047b78495a..aee243b04be 100644--- a/lib/new_post_manager.rb+++ b/lib/new_post_manager.rb@@ -40,7 +40,8 @@ class NewPostManager!!(args[:first_post_checks] &&- user.post_count == 0+ user.post_count == 0 &&+ user.topic_count == 0)enddiff --git a/spec/requests/posts_controller_spec.rb b/spec/requests/posts_controller_spec.rbindex 7e10e1a4ae0..a7e8c7d1a18 100644--- a/spec/requests/posts_controller_spec.rb+++ b/spec/requests/posts_controller_spec.rb@@ -859,6 +859,23 @@ describe PostsController doexpect(user).not_to be_silencedend+ it "doesn't enqueue posts when user first creates a topic" do+ user.user_stat.update_column(:topic_count, 1)++ post "/posts.json", params: {+ raw: 'this is the test content',+ title: 'this is the test title for the topic',+ composer_open_duration_msecs: 204,+ typing_duration_msecs: 100,+ topic_id: topic.id+ }++ expect(response.status).to eq(200)+ parsed = ::JSON.parse(response.body)++ expect(parsed["action"]).not_to be_present+ end+it "doesn't enqueue replies when the topic is closed" dotopic = Fabricate(:closed_topic)