Skip to content

Commit 348315b

Browse files
authored
Modify integration tests to not use fake server (#3506)
1 parent 82444bb commit 348315b

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
@@ -329,15 +329,27 @@ var _ = Describe("login Command", func() {
329329
})
330330
})
331331

332-
When("targeting the API fails due to an invalid certificate", func() {
333-
BeforeEach(func() {
334-
cmd.APIEndpoint = "api.example.com"
335-
fakeActor.SetTargetReturns(nil, ccerror.UnverifiedServerError{URL: "https://api.example.com"})
332+
When("certificate is invalid", func() {
333+
When("targeting the API without setting --skip-ssl-validation flag", func() {
334+
BeforeEach(func() {
335+
cmd.APIEndpoint = "api.example.com"
336+
fakeActor.SetTargetReturns(nil, ccerror.UnverifiedServerError{URL: "https://api.example.com"})
337+
})
338+
339+
It("returns an error mentioning the login command", func() {
340+
Expect(executeErr).To(MatchError(
341+
translatableerror.InvalidSSLCertError{URL: "https://api.example.com", SuggestedCommand: "login"}))
342+
})
336343
})
337344

338-
It("returns an error mentioning the login command", func() {
339-
Expect(executeErr).To(MatchError(
340-
translatableerror.InvalidSSLCertError{URL: "https://api.example.com", SuggestedCommand: "login"}))
345+
When("targeting the API with --skip-ssl-validation flag", func() {
346+
BeforeEach(func() {
347+
cmd.APIEndpoint = "api.example.com"
348+
})
349+
350+
It("login succeeds", func() {
351+
Expect(executeErr).NotTo(HaveOccurred())
352+
})
341353
})
342354
})
343355
})

integration/shared/isolated/logs_command_test.go

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

0 commit comments

Comments
 (0)