@@ -164,15 +164,15 @@ var _ = Describe("create-route Command", func() {
164164 })
165165 })
166166
167- When ("creating the route fails when the CC API version is too old for route options" , func () {
167+ When ("creating the route does not fail when the CC API version is too old for route options" , func () {
168168 BeforeEach (func () {
169169 cCAPIOldVersion = strconv .Itoa (1 )
170170 fakeConfig .APIVersionReturns (cCAPIOldVersion )
171171 })
172172
173- It ("does not create a route and gives error message" , func () {
174- Expect (executeErr ).To (HaveOccurred ())
175- Expect (fakeActor .CreateRouteCallCount ()).To (Equal (0 ))
173+ It ("does create a route and gives a warning message" , func () {
174+ Expect (executeErr ).NotTo (HaveOccurred ())
175+ Expect (fakeActor .CreateRouteCallCount ()).To (Equal (1 ))
176176 Expect (testUI .Err ).To (Say ("Your CC API" ))
177177 Expect (testUI .Err ).To (Say ("does not support per-route options" ))
178178 })
@@ -205,13 +205,24 @@ var _ = Describe("create-route Command", func() {
205205 Expect (testUI .Out ).To (Say ("OK" ))
206206 })
207207
208- It ("creates the route" , func () {
209- Expect (fakeActor .CreateRouteCallCount ()).To (Equal (1 ))
210- expectedSpaceGUID , expectedDomainName , expectedHostname , _ , _ , expectedOptions := fakeActor .CreateRouteArgsForCall (0 )
211- Expect (expectedSpaceGUID ).To (Equal (spaceGUID ))
212- Expect (expectedDomainName ).To (Equal (domainName ))
213- Expect (expectedHostname ).To (Equal (hostname ))
214- Expect (expectedOptions ).To (Equal (options ))
208+ When ("in a version of CAPI that does not support options" , func () {
209+ BeforeEach (func () {
210+ fakeActor .CreateRouteReturns (resources.Route {
211+ URL : domainName ,
212+ }, v7action.Warnings {"warnings-1" , "warnings-2" }, nil )
213+ cmdOptions = []string {}
214+ cCAPIOldVersion = strconv .Itoa (1 )
215+ fakeConfig .APIVersionReturns (cCAPIOldVersion )
216+ })
217+
218+ It ("creates the route when no options are provided" , func () {
219+ Expect (fakeActor .CreateRouteCallCount ()).To (Equal (1 ))
220+ expectedSpaceGUID , expectedDomainName , expectedHostname , _ , _ , expectedOptions := fakeActor .CreateRouteArgsForCall (0 )
221+ Expect (expectedSpaceGUID ).To (Equal (spaceGUID ))
222+ Expect (expectedDomainName ).To (Equal (domainName ))
223+ Expect (expectedHostname ).To (Equal (hostname ))
224+ Expect (expectedOptions ).To (BeNil ())
225+ })
215226 })
216227
217228 When ("passing in a hostname" , func () {
0 commit comments