debian-mirror-gitlab/spec/features/projects_spec.rb

33 lines
848 B
Ruby
Raw Normal View History

2014-09-02 18:07:02 +05:30
require 'spec_helper'
2015-04-26 12:48:37 +05:30
describe "Projects", feature: true, js: true do
2014-09-02 18:07:02 +05:30
before { login_as :user }
describe "DELETE /projects/:id" do
before do
@project = create(:project, namespace: @user.namespace)
@project.team << [@user, :master]
2015-04-26 12:48:37 +05:30
visit edit_namespace_project_path(@project.namespace, @project)
2014-09-02 18:07:02 +05:30
end
2015-04-26 12:48:37 +05:30
it "should remove project" do
expect { remove_project }.to change {Project.count}.by(-1)
2014-09-02 18:07:02 +05:30
end
2015-04-26 12:48:37 +05:30
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'
2014-09-02 18:07:02 +05:30
end
end