Commit b6f207ee authored by Luke Duncalfe's avatar Luke Duncalfe

Fix EE namespacing of DesignsCounterService

Although all tests were passing, SaveDesignsService would error when
attempting to increment the counter with:

    uninitialized constant EE::Gitlab::UsageCounters
parent 55cb82cf
......@@ -67,7 +67,7 @@ module DesignManagement
def build_repository_action(file, design)
action = new_file?(design) ? :create : :update
on_success { ::EE::Gitlab::UsageCounters::DesignsCounter.count(action) }
on_success { ::Gitlab::UsageCounters::DesignsCounter.count(action) }
{
action: action,
......
......@@ -10,7 +10,7 @@ module EE
override :usage_data_counters
def usage_data_counters
super + [::EE::Gitlab::UsageCounters::DesignsCounter]
super + [::Gitlab::UsageCounters::DesignsCounter]
end
override :features_usage_data
......
# frozen_string_literal: true
module EE::Gitlab::UsageCounters
module Gitlab::UsageCounters
class DesignsCounter
extend ::Gitlab::UsageDataCounters::RedisCounter
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe EE::Gitlab::UsageCounters::DesignsCounter do
describe Gitlab::UsageCounters::DesignsCounter do
it_behaves_like 'a redis usage counter', 'Designs', :create
it_behaves_like 'a redis usage counter', 'Designs', :update
it_behaves_like 'a redis usage counter', 'Designs', :delete
......
......@@ -58,7 +58,7 @@ describe DesignManagement::SaveDesignsService do
end
it "updates the creation count" do
counter = EE::Gitlab::UsageCounters::DesignsCounter
counter = Gitlab::UsageCounters::DesignsCounter
expect { service.execute }.to change { counter.read(:create) }.by(1)
end
......@@ -131,7 +131,7 @@ describe DesignManagement::SaveDesignsService do
end
it 'increments the update counter' do
counter = EE::Gitlab::UsageCounters::DesignsCounter
counter = Gitlab::UsageCounters::DesignsCounter
expect { service.execute }.to change { counter.read(:update) }.by 1
end
......@@ -158,7 +158,7 @@ describe DesignManagement::SaveDesignsService do
end
it 'counts one creation and one update' do
counter = EE::Gitlab::UsageCounters::DesignsCounter
counter = Gitlab::UsageCounters::DesignsCounter
expect { service.execute }
.to change { counter.read(:create) }.by(1)
.and change { counter.read(:update) }.by(1)
......@@ -187,7 +187,7 @@ describe DesignManagement::SaveDesignsService do
end
it 'increments the creation count by 2' do
counter = EE::Gitlab::UsageCounters::DesignsCounter
counter = Gitlab::UsageCounters::DesignsCounter
expect { service.execute }.to change { counter.read(:create) }.by 2
end
......
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