From 30b36c92c386e93b432166fb6f9dd973882a6d82 Mon Sep 17 00:00:00 2001 From: Jacob Vosmaer Date: Tue, 15 Mar 2016 11:03:43 +0100 Subject: Use an exception to pass messages --- spec/services/projects/housekeeping_service_spec.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'spec/services/projects') 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 -- cgit v1.2.1