diff options
Diffstat (limited to 'spec/models/namespace_spec.rb')
-rw-r--r-- | spec/models/namespace_spec.rb | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/spec/models/namespace_spec.rb b/spec/models/namespace_spec.rb index 81d5ab7a6d3..0ff959395fa 100644 --- a/spec/models/namespace_spec.rb +++ b/spec/models/namespace_spec.rb @@ -2,6 +2,7 @@ require 'spec_helper' describe Namespace do let!(:namespace) { create(:namespace) } + let(:gitlab_shell) { Gitlab::Shell.new } describe 'associations' do it { is_expected.to have_many :projects } @@ -151,11 +152,10 @@ describe Namespace do end end - describe '#move_dir' do + describe '#move_dir', :request_store do before do @namespace = create :namespace @project = create(:project_empty_repo, namespace: @namespace) - allow(@namespace).to receive(:path_changed?).and_return(true) end it "raises error when directory exists" do @@ -163,11 +163,9 @@ describe Namespace do end it "moves dir if path changed" do - new_path = @namespace.full_path + "_new" - allow(@namespace).to receive(:full_path_was).and_return(@namespace.full_path) - allow(@namespace).to receive(:full_path).and_return(new_path) - expect(@namespace).to receive(:remove_exports!) - expect(@namespace.move_dir).to be_truthy + @namespace.update_attributes(path: @namespace.full_path + '_new') + + expect(gitlab_shell.exists?(@project.repository_storage_path, "#{@namespace.path}/#{@project.path}.git")).to be_truthy end context "when any project has container images" do |