diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-04-14 09:09:14 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-04-14 09:09:14 +0000 |
commit | 4ab67d65296979ba6f5fca3142b86460b748590e (patch) | |
tree | cbaa126a09126f2e43ba006c30dc8175858573e3 /spec/helpers | |
parent | 90fa047c0dbb0a5e97c384fa6c45991c04acba5f (diff) | |
download | gitlab-ce-4ab67d65296979ba6f5fca3142b86460b748590e.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/helpers')
-rw-r--r-- | spec/helpers/ci/runners_helper_spec.rb | 29 |
1 files changed, 18 insertions, 11 deletions
diff --git a/spec/helpers/ci/runners_helper_spec.rb b/spec/helpers/ci/runners_helper_spec.rb index 6e41afac4ee..4041d66d5c4 100644 --- a/spec/helpers/ci/runners_helper_spec.rb +++ b/spec/helpers/ci/runners_helper_spec.rb @@ -3,19 +3,26 @@ require 'spec_helper' RSpec.describe Ci::RunnersHelper do - it "returns - not contacted yet" do - runner = FactoryBot.build :ci_runner - expect(runner_status_icon(runner)).to include("not connected yet") - end + describe '#runner_status_icon', :clean_gitlab_redis_cache do + it "returns - not contacted yet" do + runner = create(:ci_runner) + expect(runner_status_icon(runner)).to include("not connected yet") + end - it "returns offline text" do - runner = FactoryBot.build(:ci_runner, contacted_at: 1.day.ago, active: true) - expect(runner_status_icon(runner)).to include("Runner is offline") - end + it "returns offline text" do + runner = create(:ci_runner, contacted_at: 1.day.ago, active: true) + expect(runner_status_icon(runner)).to include("Runner is offline") + end - it "returns online text" do - runner = FactoryBot.build(:ci_runner, contacted_at: 1.second.ago, active: true) - expect(runner_status_icon(runner)).to include("Runner is online") + it "returns online text" do + runner = create(:ci_runner, contacted_at: 1.second.ago, active: true) + expect(runner_status_icon(runner)).to include("Runner is online") + end + + it "returns paused text" do + runner = create(:ci_runner, contacted_at: 1.second.ago, active: false) + expect(runner_status_icon(runner)).to include("Runner is paused") + end end describe '#runner_contacted_at' do |