Skip to content

Commit 6bdfced

Browse files
authored
Modify integration tests to not use fake server [v8] (#3505)
1 parent f10828d commit 6bdfced

File tree

4 files changed

+22
-518
lines changed

4 files changed

+22
-518
lines changed

command/v7/login_command_test.go

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -309,15 +309,27 @@ var _ = Describe("login Command", func() {
309309
})
310310
})
311311

312-
When("targeting the API fails due to an invalid certificate", func() {
313-
BeforeEach(func() {
314-
cmd.APIEndpoint = "api.example.com"
315-
fakeActor.SetTargetReturns(nil, ccerror.UnverifiedServerError{URL: "https://api.example.com"})
312+
When("certificate is invalid", func() {
313+
When("targeting the API without setting --skip-ssl-validation flag", func() {
314+
BeforeEach(func() {
315+
cmd.APIEndpoint = "api.example.com"
316+
fakeActor.SetTargetReturns(nil, ccerror.UnverifiedServerError{URL: "https://api.example.com"})
317+
})
318+
319+
It("returns an error mentioning the login command", func() {
320+
Expect(executeErr).To(MatchError(
321+
translatableerror.InvalidSSLCertError{URL: "https://api.example.com", SuggestedCommand: "login"}))
322+
})
316323
})
317324

318-
It("returns an error mentioning the login command", func() {
319-
Expect(executeErr).To(MatchError(
320-
translatableerror.InvalidSSLCertError{URL: "https://api.example.com", SuggestedCommand: "login"}))
325+
When("targeting the API with --skip-ssl-validation flag", func() {
326+
BeforeEach(func() {
327+
cmd.APIEndpoint = "api.example.com"
328+
})
329+
330+
It("login succeeds", func() {
331+
Expect(executeErr).NotTo(HaveOccurred())
332+
})
321333
})
322334
})
323335
})

integration/shared/isolated/logs_command_test.go

Lines changed: 0 additions & 239 deletions
This file was deleted.

0 commit comments

Comments
 (0)