|
1 | 1 | package user_test |
2 | 2 |
|
3 | 3 | import ( |
4 | | - "errors" |
5 | | - |
6 | 4 | "github.com/IBM-Cloud/ibm-cloud-cli-sdk/testhelpers/terminal" |
7 | 5 | . "github.com/onsi/ginkgo" |
8 | 6 | . "github.com/onsi/gomega" |
@@ -46,39 +44,5 @@ var _ = Describe("user vpn-enable", func() { |
46 | 44 | Expect(err.Error()).To(ContainSubstring("Invalid input for 'User ID'. It must be a positive integer.")) |
47 | 45 | }) |
48 | 46 | }) |
49 | | - |
50 | | - Context("Vpn enable with correct vpn ID but continue", func() { |
51 | | - It("return no error", func() { |
52 | | - fakeUI.Inputs("No") |
53 | | - err := testhelpers.RunCobraCommand(cliCommand.Command, "1234") |
54 | | - Expect(err).NotTo(HaveOccurred()) |
55 | | - Expect(fakeUI.Outputs()).To(ContainSubstring("This will Enable vpn for the user id: 1234. Continue?")) |
56 | | - Expect(fakeUI.Outputs()).To(ContainSubstring("Aborted.")) |
57 | | - }) |
58 | | - }) |
59 | | - |
60 | | - Context("Return error", func() { |
61 | | - BeforeEach(func() { |
62 | | - fakeUserManager.EditUserReturns(false, errors.New("Failed")) |
63 | | - }) |
64 | | - It("Failed edit user", func() { |
65 | | - err := testhelpers.RunCobraCommand(cliCommand.Command, "111111") |
66 | | - Expect(err).To(HaveOccurred()) |
67 | | - Expect(err.Error()).To(ContainSubstring("Failed to enable vpn for the 'User ID' ")) |
68 | | - Expect(err.Error()).To(ContainSubstring("SoftLayer_Exception_ObjectNotFound: Unable to find object with id of '123'. (HTTP 404)")) |
69 | | - }) |
70 | | - }) |
71 | | - |
72 | | - Context("Return no error", func() { |
73 | | - BeforeEach(func() { |
74 | | - fakeUserManager.EditUserReturns(true, nil) |
75 | | - }) |
76 | | - It("vpn enable", func() { |
77 | | - err := testhelpers.RunCobraCommand(cliCommand.Command, "111111") |
78 | | - Expect(err).NotTo(HaveOccurred()) |
79 | | - Expect(fakeUI.Outputs()).To(ContainSubstring("OK")) |
80 | | - Expect(fakeUI.Outputs()).To(ContainSubstring("1234 is successfully enabled.")) |
81 | | - }) |
82 | | - }) |
83 | 47 | }) |
84 | 48 | }) |
0 commit comments