summaryrefslogtreecommitdiff
path: root/spec/lib/gitlab/metrics/background_transaction_spec.rb
blob: d87d2c839ade9e5ab93cd8a054677b7205baafd7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# frozen_string_literal: true

require 'spec_helper'

describe Gitlab::Metrics::BackgroundTransaction do
  let(:test_worker_class) { double(:class, name: 'TestWorker') }

  subject { described_class.new(test_worker_class) }

  describe '#action' do
    it 'returns transaction action name' do
      expect(subject.action).to eq('TestWorker#perform')
    end
  end

  describe '#label' do
    it 'returns labels based on class name' do
      expect(subject.labels).to eq(controller: 'TestWorker', action: 'perform')
    end
  end
end