summaryrefslogtreecommitdiff
path: root/spec/models/namespace_spec.rb
diff options
context:
space:
mode:
authorKamil Trzcinski <ayufan@ayufan.eu>2016-05-16 18:03:55 -0500
committerKamil Trzcinski <ayufan@ayufan.eu>2016-05-16 18:03:55 -0500
commit91c4002a0c2f32944ec669cc159c4b1c9176866f (patch)
tree8ef37d8bbaa0cae3ff56a0f8b69b5314b4a598f2 /spec/models/namespace_spec.rb
parent72a71e9d17c75b11e82623cd9edd22ba70c9ba4f (diff)
downloadgitlab-ce-91c4002a0c2f32944ec669cc159c4b1c9176866f.tar.gz
Improve test coverage
Diffstat (limited to 'spec/models/namespace_spec.rb')
-rw-r--r--spec/models/namespace_spec.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/spec/models/namespace_spec.rb b/spec/models/namespace_spec.rb
index 4074f966299..4e68ac5e63a 100644
--- a/spec/models/namespace_spec.rb
+++ b/spec/models/namespace_spec.rb
@@ -70,6 +70,20 @@ describe Namespace, models: true do
allow(@namespace).to receive(:path).and_return(new_path)
expect(@namespace.move_dir).to be_truthy
end
+
+ context "when any project has container tags" do
+ before do
+ stub_container_registry_config(enabled: true)
+ stub_container_registry_tags('tag')
+
+ create(:empty_project, namespace: @namespace)
+
+ allow(@namespace).to receive(:path_was).and_return(@namespace.path)
+ allow(@namespace).to receive(:path).and_return('new_path')
+ end
+
+ it { expect { @namespace.move_dir }.to raise_error('Namespace cannot be moved, because at least one project has tags in container registry') }
+ end
end
describe :rm_dir do