@@ -26,22 +26,16 @@ defmodule Mindwendel.ChatCompletionsCase do
2626
2727 # Default stub: AI is disabled
2828 # Tests can override this with expect() for specific behavior
29- def setup_ai_disabled_stub ( _context ) do
30- Mindwendel.Services.ChatCompletions.ChatCompletionsServiceMock
31- |> stub ( :enabled? , fn -> false end )
32- |> stub ( :generate_ideas , fn _title , _lanes , _existing_ideas , _locale ->
33- { :error , :ai_not_enabled }
34- end )
35- |> stub ( :classify_labels , fn _title , _labels , _ideas , _locale ->
36- { :error , :ai_not_enabled }
37- end )
38-
39- :ok
40- end
29+ def setup_ai_disabled_stub ( _context ) , do: disable_ai ( )
4130
4231 # Helper to explicitly stub AI as disabled (for clarity in tests)
4332 def disable_ai do
4433 # Already stubbed in setup, but this allows explicit calls
34+ stub_ai_disabled ( )
35+ :ok
36+ end
37+
38+ defp stub_ai_disabled do
4539 Mindwendel.Services.ChatCompletions.ChatCompletionsServiceMock
4640 |> stub ( :enabled? , fn -> false end )
4741 |> stub ( :generate_ideas , fn _title , _lanes , _existing_ideas , _locale ->
@@ -50,8 +44,6 @@ defmodule Mindwendel.ChatCompletionsCase do
5044 |> stub ( :classify_labels , fn _title , _labels , _ideas , _locale ->
5145 { :error , :ai_not_enabled }
5246 end )
53-
54- :ok
5547 end
5648
5749 # Helper to set up AI enabled with specific expectations
0 commit comments