2011-10-08 17:36:38 -04:00
|
|
|
require 'spec_helper'
|
|
|
|
|
2014-10-28 14:02:01 -04:00
|
|
|
describe "Projects", feature: true, js: true do
|
2011-10-08 17:36:38 -04:00
|
|
|
before { login_as :user }
|
|
|
|
|
2012-05-27 06:39:57 -04:00
|
|
|
describe "DELETE /projects/:id" do
|
|
|
|
before do
|
2013-01-02 12:32:34 -05:00
|
|
|
@project = create(:project, namespace: @user.namespace)
|
2013-01-04 01:43:25 -05:00
|
|
|
@project.team << [@user, :master]
|
2012-05-27 06:39:57 -04:00
|
|
|
visit edit_project_path(@project)
|
|
|
|
end
|
|
|
|
|
2014-10-28 14:02:01 -04:00
|
|
|
it "should remove project" do
|
|
|
|
expect { remove_project }.to change {Project.count}.by(-1)
|
2012-05-27 06:39:57 -04:00
|
|
|
end
|
2014-10-28 10:14:40 -04:00
|
|
|
|
2014-10-28 14:02:01 -04:00
|
|
|
it 'should delete the project from disk' do
|
2014-10-07 15:55:15 -04:00
|
|
|
expect(GitlabShellWorker).to(
|
|
|
|
receive(:perform_async).with(:remove_repository,
|
|
|
|
/#{@project.path_with_namespace}/)
|
|
|
|
).twice
|
|
|
|
|
2014-10-28 14:02:01 -04:00
|
|
|
remove_project
|
2012-05-27 06:39:57 -04:00
|
|
|
end
|
|
|
|
end
|
2014-10-28 14:02:01 -04:00
|
|
|
|
|
|
|
def remove_project
|
|
|
|
click_link "Remove project"
|
|
|
|
fill_in 'confirm_name_input', with: @project.path
|
|
|
|
click_button 'Confirm'
|
|
|
|
end
|
2011-10-08 17:36:38 -04:00
|
|
|
end
|