Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
merefield committed Jan 29, 2025
1 parent 1e4f05f commit 138dfa0
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions spec/lib/post/post_prompt_utils_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,30 +28,30 @@
it "captures the right history" do
SiteSetting.chatbot_include_whispers_in_post_history = false

past_posts = ::DiscourseChatbot::PostPromptUtils.collect_past_interactions(post_1)
past_posts = ::DiscourseChatbot::PostPromptUtils.collect_past_interactions(post_1.id)
expect(past_posts.count).to equal(0)
past_posts = ::DiscourseChatbot::PostPromptUtils.collect_past_interactions(post_6)
past_posts = ::DiscourseChatbot::PostPromptUtils.collect_past_interactions(post_6.id)
expect(past_posts.count).to equal(3)
past_posts = ::DiscourseChatbot::PostPromptUtils.collect_past_interactions(post_11)
past_posts = ::DiscourseChatbot::PostPromptUtils.collect_past_interactions(post_11.id)
expect(past_posts.count).to equal(5)

post_9.destroy
past_posts = ::DiscourseChatbot::PostPromptUtils.collect_past_interactions(post_11)
past_posts = ::DiscourseChatbot::PostPromptUtils.collect_past_interactions(post_11.id)
expect(past_posts.count).to equal(5)
end

it "captures the right history when whispers are included" do
SiteSetting.chatbot_include_whispers_in_post_history = true

past_posts = ::DiscourseChatbot::PostPromptUtils.collect_past_interactions(post_1)
past_posts = ::DiscourseChatbot::PostPromptUtils.collect_past_interactions(post_1.id)
expect(past_posts.count).to equal(0)
past_posts = ::DiscourseChatbot::PostPromptUtils.collect_past_interactions(post_6)
past_posts = ::DiscourseChatbot::PostPromptUtils.collect_past_interactions(post_6.id)
expect(past_posts.count).to equal(3)
past_posts = ::DiscourseChatbot::PostPromptUtils.collect_past_interactions(post_11)
past_posts = ::DiscourseChatbot::PostPromptUtils.collect_past_interactions(post_11.id)
expect(past_posts.count).to equal(6)

post_9.destroy
past_posts = ::DiscourseChatbot::PostPromptUtils.collect_past_interactions(post_11)
past_posts = ::DiscourseChatbot::PostPromptUtils.collect_past_interactions(post_11.id)
expect(past_posts.count).to equal(6)
end

Expand Down

0 comments on commit 138dfa0

Please sign in to comment.