Commit 8eaaa442 authored by allison.browne's avatar allison.browne

Move RunnersHelper to Ci Namespace

RunnersHelper -> Ci::RunnersHelper
parent 1834d622
# frozen_string_literal: true
module RunnersHelper
module Ci::RunnersHelper
def runner_status_icon(runner)
status = runner.status
case status
......@@ -40,4 +40,4 @@ module RunnersHelper
end
end
RunnersHelper.prepend_if_ee('EE::RunnersHelper')
Ci::RunnersHelper.prepend_if_ee('EE::Ci::RunnersHelper')
# frozen_string_literal: true
module EE
module RunnersHelper
module Ci::RunnersHelper
include ::Gitlab::Utils::StrongMemoize
BUY_PIPELINE_MINUTES_NOTIFICATION_DOT = 'buy_pipeline_minutes_notification_dot'
......
......@@ -16,7 +16,7 @@
- if show_pipeline_minutes_notification_dot?(project, namespace)
- link_class << ' js-follow-link'
%li.js-buy-pipeline-minutes-notification-callout{ data: { feature_id: RunnersHelper::BUY_PIPELINE_MINUTES_NOTIFICATION_DOT,
%li.js-buy-pipeline-minutes-notification-callout{ data: { feature_id: Ci::RunnersHelper::BUY_PIPELINE_MINUTES_NOTIFICATION_DOT,
dismiss_endpoint: user_callouts_path } }
= link_to path, class: link_class, data: data_attributes do
= yield :buy_pipeline_with_subtext
......
......@@ -2,7 +2,7 @@
require "spec_helper"
RSpec.describe EE::RunnersHelper do
RSpec.describe EE::Ci::RunnersHelper do
let_it_be(:user) { create(:user) }
let_it_be(:namespace) { create(:namespace, owner: user) }
let_it_be(:project) { create(:project, namespace: namespace) }
......
......@@ -39,7 +39,7 @@ RSpec.describe 'layouts/header/_current_user_dropdown' do
expect(subject).to have_link('Buy Pipeline minutes')
expect(subject).to have_content('One of your groups is running out')
expect(subject).to have_selector('.js-follow-link')
expect(subject).to have_selector("[data-feature-id='#{RunnersHelper::BUY_PIPELINE_MINUTES_NOTIFICATION_DOT}']")
expect(subject).to have_selector("[data-feature-id='#{Ci::RunnersHelper::BUY_PIPELINE_MINUTES_NOTIFICATION_DOT}']")
expect(subject).to have_selector("[data-dismiss-endpoint='#{user_callouts_path}']")
end
end
......@@ -51,7 +51,7 @@ RSpec.describe 'layouts/header/_current_user_dropdown' do
expect(subject).to have_link('Buy Pipeline minutes')
expect(subject).to have_content('One of your groups is running out')
expect(subject).not_to have_selector('.js-follow-link')
expect(subject).not_to have_selector("[data-feature-id='#{RunnersHelper::BUY_PIPELINE_MINUTES_NOTIFICATION_DOT}']")
expect(subject).not_to have_selector("[data-feature-id='#{Ci::RunnersHelper::BUY_PIPELINE_MINUTES_NOTIFICATION_DOT}']")
expect(subject).not_to have_selector("[data-dismiss-endpoint='#{user_callouts_path}']")
end
end
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
RSpec.describe RunnersHelper do
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")
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment