summaryrefslogtreecommitdiff
path: root/spec/features/projects_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/features/projects_spec.rb')
-rw-r--r--spec/features/projects_spec.rb27
1 files changed, 19 insertions, 8 deletions
diff --git a/spec/features/projects_spec.rb b/spec/features/projects_spec.rb
index 98ba5a47ee5..cae11be7cdd 100644
--- a/spec/features/projects_spec.rb
+++ b/spec/features/projects_spec.rb
@@ -1,21 +1,32 @@
require 'spec_helper'
-describe "Projects", feature: true do
+describe "Projects", feature: true, js: true do
before { login_as :user }
describe "DELETE /projects/:id" do
before do
@project = create(:project, namespace: @user.namespace)
@project.team << [@user, :master]
- visit edit_project_path(@project)
+ visit edit_namespace_project_path(@project.namespace, @project)
end
- it "should be correct path", js: true do
- expect {
- click_link "Remove project"
- fill_in 'confirm_name_input', with: @project.path
- click_button 'Confirm'
- }.to change {Project.count}.by(-1)
+ it "should remove project" do
+ expect { remove_project }.to change {Project.count}.by(-1)
end
+
+ it 'should delete the project from disk' do
+ expect(GitlabShellWorker).to(
+ receive(:perform_async).with(:remove_repository,
+ /#{@project.path_with_namespace}/)
+ ).twice
+
+ remove_project
+ end
+ end
+
+ def remove_project
+ click_link "Remove project"
+ fill_in 'confirm_name_input', with: @project.path
+ click_button 'Confirm'
end
end