Skip to content

A platform for community discussion. Free, open, simple.

DEV: Add missing http mocks in specs (#39229)

Jarek Radosz2fd0c459add6
diff --git a/plugins/discourse-ai/spec/system/ai_bot/homepage_spec.rb b/plugins/discourse-ai/spec/system/ai_bot/homepage_spec.rb
index 97ac23d6659..e2d1784e4d2 100644
--- a/plugins/discourse-ai/spec/system/ai_bot/homepage_spec.rb
+++ b/plugins/discourse-ai/spec/system/ai_bot/homepage_spec.rb
@@ -360,8 +360,10 @@ RSpec.describe "AI Bot - Homepage" do
expect(composer).to be_opened
composer.fill_in(with: "Hello bot replying to you")
- composer.submit
- expect(page).to have_content("Hello bot replying to you")
+ DiscourseAi::Completions::Llm.with_prepared_responses(["hello user"]) do
+ composer.submit
+ expect(page).to have_content("Hello bot replying to you")
+ end
end
it "does not render custom sidebar on non-authored bot pms" do
diff --git a/spec/system/composer/prosemirror_autocomplete_spec.rb b/spec/system/composer/prosemirror_autocomplete_spec.rb
index e43b598d065..b98953cc4e5 100644
--- a/spec/system/composer/prosemirror_autocomplete_spec.rb
+++ b/spec/system/composer/prosemirror_autocomplete_spec.rb
@@ -130,6 +130,11 @@ describe "Composer - ProseMirror - Autocomplete" do
SiteSetting.external_system_avatars_url =
"/letter_avatar_proxy/v4/letter/{first_letter}/{color}/{size}.png"
SiteSetting.unicode_usernames = true
+
+ stub_request(:get, %r{\Ahttps://avatars\.discourse-cdn\.com/}).to_return(
+ status: 200,
+ body: "",
+ )
end
it "renders unicode mentions as nodes" do