Skip to content

Commit 86b195c

Browse files
committed
Don't print out tokens in specs
1 parent 761345f commit 86b195c

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

spec/openai/client/http_spec.rb

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -201,10 +201,12 @@
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
@@ -217,10 +219,12 @@
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

0 commit comments

Comments
 (0)