Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
merefield committed Jun 3, 2024
1 parent b56b6ec commit 55650eb
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions spec/lib/functions/forum_search_function_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,11 @@
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)).to include(post_3.raw)
expect(subject.process(args)[:topic_ids_found]).to eq([])
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]).not_to include(post_2.id)
expect(subject.process(args)[:result]).to include(post_3.raw)
end

it "returns contents of a high ranking Topic" do
Expand All @@ -59,11 +63,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)).to include(post_1.raw)
expect(subject.process(args)).to include(post_2.raw)
expect(subject.process(args)).to include(post_3.raw)
expect(subject.process(args)).to include(topic_1.title)
expect(subject.process(args)).not_to include(topic_3.title)
expect(subject.process(args)).not_to include(post_4.raw)
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)
end
end

0 comments on commit 55650eb

Please sign in to comment.