summaryrefslogtreecommitdiff
path: root/spec/services/ci/update_runner_service_spec.rb
diff options
context:
space:
mode:
authorLin Jen-Shin <godfat@godfat.org>2017-01-20 21:57:01 +0800
committerLin Jen-Shin <godfat@godfat.org>2017-01-21 02:18:14 +0800
commit7a109402a866db1c84ef9af1c14e148ec944aa22 (patch)
tree11c3185d2b5d3326bdbfb49a53fe28de8156bb16 /spec/services/ci/update_runner_service_spec.rb
parent4b7e8f257074aa5af3816817d8d74d7ceb399b8a (diff)
downloadgitlab-ce-7a109402a866db1c84ef9af1c14e148ec944aa22.tar.gz
Prefer service object over after_save hook
Closes #26921
Diffstat (limited to 'spec/services/ci/update_runner_service_spec.rb')
-rw-r--r--spec/services/ci/update_runner_service_spec.rb18
1 files changed, 18 insertions, 0 deletions
diff --git a/spec/services/ci/update_runner_service_spec.rb b/spec/services/ci/update_runner_service_spec.rb
new file mode 100644
index 00000000000..8429881dd15
--- /dev/null
+++ b/spec/services/ci/update_runner_service_spec.rb
@@ -0,0 +1,18 @@
+require 'spec_helper'
+
+describe Ci::UpdateRunnerService, services: true do
+ let(:runner) { create(:ci_runner) }
+
+ describe '#update' do
+ before do
+ allow(runner).to receive(:tick_runner_queue)
+
+ described_class.new(runner).update(description: 'new runner')
+ end
+
+ it 'updates the runner and ticking the queue' do
+ expect(runner.description).to eq('new runner')
+ expect(runner).to have_received(:tick_runner_queue)
+ end
+ end
+end