Annotations and test update

This commit is contained in:
Nat 2025-03-21 13:54:03 +08:00
parent 7d6611def6
commit 81647dc590
No known key found for this signature in database
GPG Key ID: 4938B35D927EC773
2 changed files with 19 additions and 0 deletions

View File

@ -13,3 +13,21 @@ module DiscourseSolved
validates :answer_post_id, presence: true
end
end
# == Schema Information
#
# Table name: discourse_solved_solved_topics
#
# id :bigint not null, primary key
# topic_id :integer not null
# answer_post_id :integer not null
# accepter_user_id :integer not null
# topic_timer_id :integer
# created_at :datetime not null
# updated_at :datetime not null
#
# Indexes
#
# index_discourse_solved_solved_topics_on_answer_post_id (answer_post_id) UNIQUE
# index_discourse_solved_solved_topics_on_topic_id (topic_id) UNIQUE
#

View File

@ -423,6 +423,7 @@ RSpec.describe "Managing Posts solved status" do
expect(p1.topic.assignment.status).to eq("New")
DiscourseSolved.accept_answer!(p1, user)
topic.reload
expect(topic.solved.answer_post_id).to eq(p1.id)
expect(p1.topic.assignment.reload.status).to eq("Done")