Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'spec/helpers/ci/runners_helper_spec.rb')
-rw-r--r--spec/helpers/ci/runners_helper_spec.rb30
1 files changed, 19 insertions, 11 deletions
diff --git a/spec/helpers/ci/runners_helper_spec.rb b/spec/helpers/ci/runners_helper_spec.rb
index 6e41afac4ee..94d4d620de9 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
@@ -77,6 +84,7 @@ RSpec.describe Ci::RunnersHelper do
describe '#toggle_shared_runners_settings_data' do
let_it_be(:group) { create(:group) }
+
let(:project_with_runners) { create(:project, namespace: group, shared_runners_enabled: true) }
let(:project_without_runners) { create(:project, namespace: group, shared_runners_enabled: false) }