Skip to content

Commit

Permalink
FIX: update specs to match last fix
Browse files Browse the repository at this point in the history
  • Loading branch information
merefield committed Oct 29, 2024
1 parent 34b9a69 commit 4d3513f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion plugin.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# frozen_string_literal: true
# name: discourse-chatbot
# about: a plugin that allows you to have a conversation with a configurable chatbot in Discourse Chat, Topics and Private Messages
# version: 1.4.1
# version: 1.4.2
# authors: merefield
# url: https://github.com/merefield/discourse-chatbot

Expand Down
26 changes: 13 additions & 13 deletions spec/lib/functions/forum_search_function_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,12 @@
expect(topic_1).not_to be_nil
expect(topic_2).not_to be_nil
expect(topic_3).not_to be_nil
expect(subject.process(args)[:topic_ids_found]).to eq([post_3.topic_id, post_5.topic_id])
expect(subject.process(args)[:post_ids_found]).to include(post_5.id)
expect(subject.process(args)[:post_ids_found]).to include(post_3.id)
expect(subject.process(args)[:post_ids_found]).to include(post_2.id)
expect(subject.process(args)[:post_ids_found]).not_to include(post_4.id)
expect(subject.process(args)[:result]).to include(post_3.raw)
expect(subject.process(args)[:answer][:topic_ids_found]).to eq([post_3.topic_id, post_5.topic_id])
expect(subject.process(args)[:answer][:post_ids_found]).to include(post_5.id)
expect(subject.process(args)[:answer][:post_ids_found]).to include(post_3.id)
expect(subject.process(args)[:answer][:post_ids_found]).to include(post_2.id)
expect(subject.process(args)[:answer][:post_ids_found]).not_to include(post_4.id)
expect(subject.process(args)[:answer][:result]).to include(post_3.raw)
end

it "returns contents of a high ranking Topic" do
Expand All @@ -64,13 +64,13 @@
expect(topic_1).not_to be_nil
expect(topic_2).not_to be_nil
expect(topic_3).not_to be_nil
expect(subject.process(args)[:topic_ids_found]).to include(topic_1.id)
expect(subject.process(args)[:result]).to include(post_1.raw)
expect(subject.process(args)[:result]).to include(post_2.raw)
expect(subject.process(args)[:result]).to include(post_3.raw)
expect(subject.process(args)[:result]).to include(topic_1.title)
expect(subject.process(args)[:result]).not_to include(topic_3.title)
expect(subject.process(args)[:result]).not_to include(post_4.raw)
expect(subject.process(args)[:answer][:topic_ids_found]).to include(topic_1.id)
expect(subject.process(args)[:answer][:result]).to include(post_1.raw)
expect(subject.process(args)[:answer][:result]).to include(post_2.raw)
expect(subject.process(args)[:answer][:result]).to include(post_3.raw)
expect(subject.process(args)[:answer][:result]).to include(topic_1.title)
expect(subject.process(args)[:answer][:result]).not_to include(topic_3.title)
expect(subject.process(args)[:answer][:result]).not_to include(post_4.raw)
end

it "finds urls with a post id" do
Expand Down

0 comments on commit 4d3513f

Please sign in to comment.