summaryrefslogtreecommitdiff
path: root/spec/services/projects
diff options
context:
space:
mode:
authorJacob Vosmaer <contact@jacobvosmaer.nl>2016-03-15 11:03:43 +0100
committerJacob Vosmaer <contact@jacobvosmaer.nl>2016-03-15 11:03:43 +0100
commit30b36c92c386e93b432166fb6f9dd973882a6d82 (patch)
tree3a1ad27bee57f67a2c16bc44aaad38cbae51bf3e /spec/services/projects
parent0beae70efaafc361cf15c13231bdc5ed6de8569f (diff)
downloadgitlab-ce-30b36c92c386e93b432166fb6f9dd973882a6d82.tar.gz
Use an exception to pass messages
Diffstat (limited to 'spec/services/projects')
-rw-r--r--spec/services/projects/housekeeping_service_spec.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/spec/services/projects/housekeeping_service_spec.rb b/spec/services/projects/housekeeping_service_spec.rb
index 4c3577149f9..93bf1b81fbe 100644
--- a/spec/services/projects/housekeeping_service_spec.rb
+++ b/spec/services/projects/housekeeping_service_spec.rb
@@ -14,7 +14,7 @@ describe Projects::HousekeepingService do
expect(subject).to receive(:try_obtain_lease).and_return(true)
expect(GitlabShellWorker).to receive(:perform_async).with(:gc, project.path_with_namespace)
- expect(subject.execute).to include('successfully started')
+ subject.execute
expect(project.pushes_since_gc).to eq(0)
end
@@ -22,8 +22,8 @@ describe Projects::HousekeepingService do
expect(subject).to receive(:try_obtain_lease).and_return(false)
expect(GitlabShellWorker).not_to receive(:perform_async)
- expect(subject.execute).to include('already triggered')
- expect(project.pushes_since_gc).to eq(3)
+ expect { subject.execute }.to raise_error(Projects::HousekeepingService::LeaseTaken)
+ expect(project.pushes_since_gc).to eq(0)
end
end