Commit fa398636 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets
parent c71792d9
require 'spec_helper' require 'spec_helper'
describe "Projects", feature: true do describe "Projects", feature: true, js: true do
before { login_as :user } before { login_as :user }
describe "DELETE /projects/:id" do describe "DELETE /projects/:id" do
...@@ -10,21 +10,23 @@ describe "Projects", feature: true do ...@@ -10,21 +10,23 @@ describe "Projects", feature: true do
visit edit_project_path(@project) visit edit_project_path(@project)
end end
it "should be correct path", js: true do it "should remove project" do
expect { expect { remove_project }.to change {Project.count}.by(-1)
click_link "Remove project"
fill_in 'confirm_name_input', with: @project.path
click_button 'Confirm'
}.to change {Project.count}.by(-1)
end end
it 'should delete the project from the database and disk' do it 'should delete the project from disk' do
expect(GitlabShellWorker).to( expect(GitlabShellWorker).to(
receive(:perform_async).with(:remove_repository, receive(:perform_async).with(:remove_repository,
/#{@project.path_with_namespace}/) /#{@project.path_with_namespace}/)
).twice ).twice
expect { click_link "Remove project" }.to change {Project.count}.by(-1) remove_project
end end
end end
def remove_project
click_link "Remove project"
fill_in 'confirm_name_input', with: @project.path
click_button 'Confirm'
end
end end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment