Fix commands API

pull/15934/head
Alberto Miedes Garcés 4 years ago
parent 0833d724c8
commit e488af1bdf

@ -4,10 +4,11 @@ module Carto
include ::LoggerHelper
attr_accessor :notifications_topic
attr_accessor :notifications_topic, :logger
def initialize(notifications_topic)
self.notifications_topic = notifications_topic
def initialize(notifications_topic:, logger:)
@notifications_topic = notifications_topic
@logger = logger
end
private

@ -5,14 +5,6 @@ module Carto
module Subscribers
class CentralUserCommands < ::Carto::Subscribers::Base
attr_reader :notifications_topic,
:logger
def initialize(notifications_topic:, logger:)
@notifications_topic = notifications_topic
@logger = logger
end
def update_user(payload)
Carto::Common::CurrentRequest.with_request_id(payload[:request_id]) do
logger.info(message: 'Processing :update_user', class_name: self.class.name)

@ -4,7 +4,7 @@ describe Carto::Subscribers::CentralOrganizationCommands do
include CartoDB::Factories
let(:notifications_topic) { mock }
let(:central_organization_commands) { described_class.new(notifications_topic) }
let(:central_organization_commands) { described_class.new(notifications_topic: notifications_topic) }
let(:organization) { create_organization_with_users(seats: 10) }
describe '#update_organization' do

Loading…
Cancel
Save