summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorAlexis Reigel <alexis.reigel.ext@siemens.com>2018-06-06 15:29:40 +0200
committerAlexis Reigel <alexis.reigel.ext@siemens.com>2018-08-20 17:12:15 +0200
commit00647b31b4741102451a2d785a43ef14bb818e24 (patch)
tree7d94580a6d4f83fd5684f66691cbd52b7d904c61 /spec
parent64d4f3b2a45a01e23f6c45515f4f0271ea6fd4a0 (diff)
downloadgitlab-ce-00647b31b4741102451a2d785a43ef14bb818e24.tar.gz
add offline scope to Ci::Runner
Diffstat (limited to 'spec')
-rw-r--r--spec/models/ci/runner_spec.rb13
1 files changed, 12 insertions, 1 deletions
diff --git a/spec/models/ci/runner_spec.rb b/spec/models/ci/runner_spec.rb
index 953af2c4710..f1d0ed15d29 100644
--- a/spec/models/ci/runner_spec.rb
+++ b/spec/models/ci/runner_spec.rb
@@ -223,7 +223,7 @@ describe Ci::Runner do
subject { described_class.online }
before do
- @runner1 = create(:ci_runner, :instance, contacted_at: 1.year.ago)
+ @runner1 = create(:ci_runner, :instance, contacted_at: 1.hour.ago)
@runner2 = create(:ci_runner, :instance, contacted_at: 1.second.ago)
end
@@ -300,6 +300,17 @@ describe Ci::Runner do
end
end
+ describe '.offline' do
+ subject { described_class.offline }
+
+ before do
+ @runner1 = create(:ci_runner, :instance, contacted_at: 1.hour.ago)
+ @runner2 = create(:ci_runner, :instance, contacted_at: 1.second.ago)
+ end
+
+ it { is_expected.to eq([@runner1])}
+ end
+
describe '#can_pick?' do
set(:pipeline) { create(:ci_pipeline) }
let(:build) { create(:ci_build, pipeline: pipeline) }