Commit a70005e6 authored by Doug Stull's avatar Doug Stull

Remove use of needless constant in pendo tracker

parent 6926aced
Pipeline #76383843 failed with stages
in 69 minutes and 37 seconds
......@@ -4,15 +4,13 @@ module Gitlab
class PendoTracker
class << self
def url
PENDO_URL % api_key
'https://cdn.pendo.io/agent/static/%s/pendo.js' % api_key
end
private
PENDO_URL = 'https://cdn.pendo.io/agent/static/%s/pendo.js'
def api_key
Settings.gitlab['pendo_api_key'] || fail('Pendo tracker GITLAB_PENDO_API_KEY environment variable is not set') # rubocop:disable Style/SignalException
Settings.gitlab['pendo_api_key'] || raise('Pendo tracker GITLAB_PENDO_API_KEY environment variable is not set')
end
end
end
......
......@@ -5,8 +5,7 @@ describe Gitlab::PendoTracker do
describe '.url' do
context 'valid key' do
before do
stub_env('GITLAB_PENDO_API_KEY', 'abc123')
Settings.gitlab['pendo_api_key'] = ENV['GITLAB_PENDO_API_KEY']
Settings.gitlab['pendo_api_key'] = 'abc123'
end
it 'has a valid url with js file specified' do
......
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