You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: lib/cloud_controller/stack_state_validator.rb
+11-7Lines changed: 11 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -6,23 +6,27 @@ class RestrictedStackError < StackValidationError; end
6
6
defself.validate_for_new_app!(stack)
7
7
return[]ifstack.active?
8
8
9
-
raiseDisabledStackError.new("Stack '#{stack.name}' is disabled and cannot be used for staging new applications. #{stack.description}")ifstack.disabled?
raiseRestrictedStackError.new("Stack '#{stack.name}' is restricted and cannot be used for staging new applications. #{stack.description}")ifstack.restricted?
raiseDisabledStackError.new("Stack '#{stack.name}' is disabled and cannot be used for staging new applications. #{stack.description}")ifstack.disabled?
end.toraise_error(StackStateValidator::RestrictedStackError,/Stack '#{stack.name}' is restricted and cannot be used for staging new applications./)
47
+
end.toraise_error(StackStateValidator::RestrictedStackError,/The stack '#{stack.name}' is '#{StackStates::STACK_RESTRICTED}' and cannot be used for staging./)
it'raises RestrictedStackError which is a StackStateValidator::Error'do
64
57
expectdo
65
58
StackStateValidator.validate_for_new_app!(stack)
@@ -73,20 +66,14 @@ module VCAP::CloudController
73
66
it'returns a disabled error message'do
74
67
expectdo
75
68
StackStateValidator.validate_for_new_app!(stack)
76
-
end.toraise_error(StackStateValidator::DisabledStackError,/Stack '#{stack.name}' is disabled and cannot be used for staging new applications./)
69
+
end.toraise_error(StackStateValidator::DisabledStackError,/The stack '#{stack.name}' is '#{StackStates::STACK_DISABLED}' and cannot be used for staging./)
end.toraise_error(StackStateValidator::DisabledStackError,/Stack '#{stack.name}' is disabled and cannot be used for staging new applications./)
135
+
end.toraise_error(StackStateValidator::DisabledStackError,/The stack '#{stack.name}' is '#{StackStates::STACK_DISABLED}' and cannot be used for staging./)
0 commit comments