Commit 58ab8a4a authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Fix tests and increase delay time before remove repository

Signed-off-by: default avatarDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
parent fd1723f0
...@@ -44,7 +44,7 @@ module Projects ...@@ -44,7 +44,7 @@ module Projects
if gitlab_shell.mv_repository(path, new_path) if gitlab_shell.mv_repository(path, new_path)
log_info("Repository \"#{path}\" moved to \"#{new_path}\"") log_info("Repository \"#{path}\" moved to \"#{new_path}\"")
GitlabShellWorker.perform_in(30.seconds, :remove_repository, new_path) GitlabShellWorker.perform_in(5.minutes, :remove_repository, new_path)
else else
false false
end end
......
...@@ -13,15 +13,6 @@ describe "Projects", feature: true, js: true do ...@@ -13,15 +13,6 @@ describe "Projects", feature: true, js: true do
it "should remove project" do it "should remove project" do
expect { remove_project }.to change {Project.count}.by(-1) expect { remove_project }.to change {Project.count}.by(-1)
end 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 end
def remove_project def remove_project
......
...@@ -57,14 +57,14 @@ describe API::API, api: true do ...@@ -57,14 +57,14 @@ describe API::API, api: true do
expect(json_response.first['name']).to eq(project.name) expect(json_response.first['name']).to eq(project.name)
expect(json_response.first['owner']['username']).to eq(user.username) expect(json_response.first['owner']['username']).to eq(user.username)
end end
it 'should include the project labels as the tag_list' do it 'should include the project labels as the tag_list' do
get api('/projects', user) get api('/projects', user)
response.status.should == 200 response.status.should == 200
json_response.should be_an Array json_response.should be_an Array
json_response.first.keys.should include('tag_list') json_response.first.keys.should include('tag_list')
end end
context 'and using search' do context 'and using search' do
it 'should return searched project' do it 'should return searched project' do
get api('/projects', user), { search: project.name } get api('/projects', user), { search: project.name }
...@@ -792,11 +792,6 @@ describe API::API, api: true do ...@@ -792,11 +792,6 @@ describe API::API, api: true do
describe 'DELETE /projects/:id' do describe 'DELETE /projects/:id' do
context 'when authenticated as user' do context 'when authenticated as user' do
it 'should remove project' do it 'should remove project' do
expect(GitlabShellWorker).to(
receive(:perform_async).with(:remove_repository,
/#{project.path_with_namespace}/)
).twice
delete api("/projects/#{project.id}", user) delete api("/projects/#{project.id}", user)
expect(response.status).to eq(200) expect(response.status).to eq(200)
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