| 
									
										
										
										
											2023-06-21 17:10:30 +10:00
										 |  |  | #frozen_string_literal: true | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | require_relative "../../../../support/openai_completions_inference_stubs" | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | RSpec.describe DiscourseAi::AiBot::Commands::TimeCommand do | 
					
						
							|  |  |  |   describe "#process" do | 
					
						
							|  |  |  |     it "can generate correct info" do | 
					
						
							|  |  |  |       freeze_time | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-08-04 09:37:58 +10:00
										 |  |  |       args = { timezone: "America/Los_Angeles" } | 
					
						
							|  |  |  |       info = DiscourseAi::AiBot::Commands::TimeCommand.new(nil, nil).process(**args) | 
					
						
							| 
									
										
										
										
											2023-06-21 17:10:30 +10:00
										 |  |  | 
 | 
					
						
							|  |  |  |       expect(info).to eq({ args: args, time: Time.now.in_time_zone("America/Los_Angeles").to_s }) | 
					
						
							|  |  |  |       expect(info.to_s).not_to include("not_here") | 
					
						
							|  |  |  |     end | 
					
						
							|  |  |  |   end | 
					
						
							|  |  |  | end |