Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDylan Griffith <dyl.griffith@gmail.com>2019-07-10 08:33:09 +0300
committerDylan Griffith <dyl.griffith@gmail.com>2019-07-11 10:22:58 +0300
commitdacd0ee18b617f0c81c4a478a4d801b3c37e0c56 (patch)
treeb129e20413cefe21c2ad33c890b223d0a37a4928 /spec/support/shared_examples/policies
parent4efc8574cb45369797cf902d4e9676506a6e4cf7 (diff)
Refactor: model errors for multi cluster validation
The current approach requires catching exceptions to handle these errors and callers are already handling model validations so it seems more appropriate. Also it seemed to convoluted to add this logic directly to the model since the model needs to check too many possible associations to determine whether or not there are more than one cluster since the model doesn't know what it's being created on. Additionally we only wanted to validate during create to avoid the risk of existing models becoming invalid by many different edge cases.
Diffstat (limited to 'spec/support/shared_examples/policies')
-rw-r--r--spec/support/shared_examples/policies/clusterable_shared_examples.rb8
1 files changed, 0 insertions, 8 deletions
diff --git a/spec/support/shared_examples/policies/clusterable_shared_examples.rb b/spec/support/shared_examples/policies/clusterable_shared_examples.rb
index d99f94c76c3..4f9873d53e4 100644
--- a/spec/support/shared_examples/policies/clusterable_shared_examples.rb
+++ b/spec/support/shared_examples/policies/clusterable_shared_examples.rb
@@ -24,14 +24,6 @@ shared_examples 'clusterable policies' do
context 'with no clusters' do
it { expect_allowed(:add_cluster) }
end
-
- context 'with an existing cluster' do
- before do
- cluster
- end
-
- it { expect_disallowed(:add_cluster) }
- end
end
end
end