File tree Expand file tree Collapse file tree 1 file changed +12
-8
lines changed Expand file tree Collapse file tree 1 file changed +12
-8
lines changed Original file line number Diff line number Diff line change 201201
202202 let ( :headers ) { OpenAI ::Client . new . send ( :headers ) }
203203
204- it {
205- expect ( headers ) . to eq ( { "Authorization" => "Bearer #{ OpenAI . configuration . access_token } " ,
206- "Content-Type" => "application/json" } )
207- }
204+ it "includes expected headers" do
205+ expect ( headers ) . to have_key ( "Authorization" )
206+ expect ( headers [ "Authorization" ] ) . to match ( /^Bearer .+/ )
207+ expect ( headers ) . to have_key ( "Content-Type" )
208+ expect ( headers [ "Content-Type" ] ) . to eq ( "application/json" )
209+ end
208210
209211 describe "with Azure" do
210212 before do
217219
218220 let ( :headers ) { OpenAI ::Client . new . send ( :headers ) }
219221
220- it {
221- expect ( headers ) . to eq ( { "Content-Type" => "application/json" ,
222- "api-key" => OpenAI . configuration . access_token } )
223- }
222+ it "includes expected headers" do
223+ expect ( headers ) . to have_key ( "api-key" )
224+ expect ( headers [ "api-key" ] ) . not_to be_nil
225+ expect ( headers ) . to have_key ( "Content-Type" )
226+ expect ( headers [ "Content-Type" ] ) . to eq ( "application/json" )
227+ end
224228 end
225229 end
226230
You can’t perform that action at this time.
0 commit comments